- OpenAIUpdated
- Anthropic
- Google Gemini
- Google Vertex AI
- Ollama
- Grok (xAI)
- GroqUpdated
- Mistral
- Cohere
- TypeSafe
- Ollaya
- ElevenLabs
- fal.ai
- Reactor
- World Labs
- OpenRouter AdapterUpdated
- Perplexity Search
- Vercel AI Gateway
- Lovable AI Gateway
- OpenAI-CompatibleUpdated
- LLM Gateway
- CloudflareUpdated
- Claude Code
- Codex
- OpenCode
- Grok Build
- ACP-Compatible
- Amazon BedrockUpdated
- BytePlus
Ollaya
You want a queue, an urgency, and a yes or no from a ticket that stays on your machine. Install Ollaya. Then pass ollayaDecider to decide().
The adapter covers evaluate only. It sends POST /v1/systemone to a local Ollaya server with fetch. There is no Ollaya SDK.
Install the server#
On macOS or Linux, run:
curl -fsSL https://ollaya.dev/install.sh | shOn Windows, run this in PowerShell:
irm https://ollaya.dev/install.ps1 | iexThe server listens on http://127.0.0.1:11435. This adapter uses that URL by default.
- Run ollaya serve.
- Run ollaya pull laya:latest.
The download page and the desktop app are on ollaya.dev/download.
Install the adapter#
npm i @tanstack/ai @tanstack/ai-ollayapnpm add @tanstack/ai @tanstack/ai-ollayayarn add @tanstack/ai @tanstack/ai-ollayabun add @tanstack/ai @tanstack/ai-ollayaEvaluate#
import { decide, choice, score, boolean } from "@tanstack/ai";
import { ollayaDecider } from "@tanstack/ai-ollaya";
const ticket = {
subject: "Charged twice for the same invoice",
body: "Please refund the extra payment.",
};
const result = await decide({
adapter: ollayaDecider("laya:latest"),
state: ticket,
questions: {
queue: choice({
instructions: "Which team should handle this ticket?",
options: {
billing: "Payments, invoices, refunds",
tech: "Bugs, outages, integrations",
sales: "Pricing, upgrades, new accounts",
},
}),
urgency: score({
instructions: "How urgent is this ticket?",
levels: ["low", "medium", "high"],
}),
refund: boolean({
instructions: "Is the customer asking for a refund?",
}),
},
});
console.log(result.queue.value);
console.log(result.urgency.value);
console.log(result.refund.value);
console.log(result.meta.model);
console.log(result.meta.usage);You now have result.queue.value, result.urgency.value, and result.refund.value.
See Evaluate for the rest of decide().
When you request laya:latest, result.meta.model can be laya:en or laya:multilingual. The server picks the model from the text.
Models#
| Model | Description |
|---|---|
| laya:latest | Routes each request to laya:en or laya:multilingual. |
| laya:en | English decision model (ModernBERT-large). |
| laya:multilingual | Decision model for 100+ languages (mmBERT-base). |
You can pass any other model tag as a string.
Host and API key#
By default the adapter calls http://127.0.0.1:11435. The adapter does not read environment variables. If the server is on another host, pass baseURL. If the server requires OLLAYA_API_KEY, pass apiKey.
import { ollayaDecider } from "@tanstack/ai-ollaya";
const adapter = ollayaDecider("laya:latest", {
baseURL: "http://my-host:11435",
apiKey: "local-token",
});baseUrl and headers are aliases of baseURL and defaultHeaders. If you set both forms, baseURL and defaultHeaders win. A blank baseURL keeps the default host.
API reference#
ollayaDecider(model, config?)#
Creates an evaluate adapter.
- model: "laya:latest", "laya:en", "laya:multilingual", or another model tag
- config.baseURL: server URL (default http://127.0.0.1:11435). baseUrl is an alias. A blank value keeps the default.
- config.apiKey: bearer token when the server requires OLLAYA_API_KEY
- config.defaultHeaders: extra request headers. headers is an alias.
- config.fetch: override fetch
The adapter sends POST /v1/systemone to that base URL.
Next steps#
- Evaluate guide: full decide() walkthrough
- Evaluate a ticket: build a Start route