Skip to content

v1.0.20 — Xano AI in the SDK

Choose a tag to compare

@xanojustin xanojustin released this 11 Nov 22:29
· 14 commits to main since this release

This release brings Xano AI to the SDK. You can author the eight AI statements, run agents on Xano AI, and set where those models run, at the statement, agent or workspace level. Xano AI also works on a local Xano Engine with no key to copy. A new ai models command shows the current models, so an agent can pick one without waiting for an SDK release. It also fixes preflight against Xano Cloud's new table audit blocks.

npm install @xano/sdk@1.0.20

The eight Xano AI statements are authorable under s.ai

s.ai.text.generate, image.generate, video.generate, music.generate, speech.generate, speech.transcribe, embedding.create and rerank call Xano AI models with no provider key. model is optional: leave it out and the statement runs its suggested model. location, aspect_ratio, image_size, resolution, response_format and save_to_files refuse a value the engine would reject at build time. Each as result is typed, so ref("out.text") infers string. All eight were proven byte-identical against a live engine.

Model fields accept any model and autocomplete the known ones

model (and voice on speech) takes any string, so a model added after this release still compiles. Your editor suggests the models current when the SDK was built, with retired models left out.

xanosdk ai models prints the live Xano AI catalog

It shows each statement's models, the suggested one, the locations each can run at, its options and list price. --json gives a versioned document for agents, and --all includes retired models. It needs no login. It fails with a distinct message and exit code when Xano AI is not offered, the catalog has not been fetched yet, or the host can't be reached. It never shows a stale list.

Agents can run on Xano AI with a chosen model and location

agent({ llm: { type: "xano-ai", model, location } }) runs on Xano AI, and ai.agent.run uses the agent's location. A templated or non-literal model is refused at build time: the engine resolves the model before it renders templates, so such an agent would silently run the default model.

Set the workspace's Xano AI location in code

workspaceConfig({ settings: { ai_settings: { providers: { "xano-ai": { location: "eu" } } } } }) sets the default location for every AI call that leaves its own blank. Only lowercase "", us, global and eu are accepted, because the engine silently stores anything else as "". A deploy that omits the block keeps a location set in the dashboard. A block without model would clear a dashboard-set model, and the live diff now shows that change before you deploy.

Xano AI works on the local Xano Engine with no key to copy

Every deploy --local, and every engine start or restart, gets a Xano AI credential from your xanosdk login sign-in and hands it to the engine. Usage is billed to you; --ai-billing instance, or "aiBilling": "instance" under xanosdk."@xano/sdk" in package.json, bills the instance owner instead (the owner or a billing member only). The credential lasts as long as the engine, a day at most, and each deploy renews it. The deploy prints one Xano AI: line saying it is on and who pays, or why it is off and how to fix it; it never fails a deploy, and --json carries an ai object.

Sign in again to turn it on. xanosdk login now signs in as Xano's own xanosdk client, which is the only client allowed to spend AI credits. A sign-in from an earlier version reports "has a sign-in without Xano AI access" until you run xanosdk login again.

Preflight ignores Xano Cloud's default table audit blocks

Since Xano Cloud added table audit trails, every pushed table came back with default audit and audit_log blocks, and preflight reported them as differences. They are now read as absent when every member is at its default.

A downloaded Xano Engine names its license once

deploy --local and local update print one line with the Xano Engine License link when they download a new engine release. Nothing prints for a cached engine.

Notes

  • Xano AI on the local Xano Engine needs an engine release that reads the credential file. Until one ships, the CLI hands the credential over but the engine does not use it.
  • The model suggestions are a snapshot: run xanosdk ai models --json for the current list.
  • The catalog lists no rerank model yet, so rerank's model field suggests nothing. Any model string is still accepted.