Tasks and routes
The built-in tasks, your own tasks, and every field of a route in sypnia.toml.
The built-in tasks
| Task | For |
|---|---|
chat | a conversation with a person of your app |
write | short texts: a message, a description, an e-mail |
code | reading and writing code (Sypnia Agent uses it) |
summarize | a long text or a set of facts into a few sentences |
extract | data out of text, as JSON that follows your schema |
classify | one label out of a list: «question», «complaint», «order» |
vision | reading images and documents |
embed | turning text into an embedding |
In Sypnia Cloud each built-in task has a default model, chosen and tested by Sypnia for that kind of work, for its quality, its speed and its price. When a better one appears the default changes, and the change is announced in your project’s notices a week before. Write pin: true in a route to keep the model you have.
A self-hosted gateway has no default models: you choose every one.
Your own tasks
Name a task after what it does in your app: allergen-answer, bread-of-the-day. A task of your own is a route like any other, and it makes usage easy to read: «allergen-answer spent this much» says more than «chat spent this much».
Asking for a task
{ "model": "task:allergen-answer", "messages": [ … ] }You can also name a model directly ("model": "openrouter/<model id>"). It is still limited, priced and traced, but it skips the route’s fallbacks and options. A project can refuse direct model names with direct_models: false.
Every field of a route
Routes live in sypnia.toml, the one configuration file at the root of your repository that every Sypnia product shares: direct_models in the [ai] table, and one [ai.tasks.<name>] table per task. Sypnia AI reads only its own tables.
[ai]
direct_models = false
[ai.tasks.allergen-answer]
model = "default"
fallbacks = ["default"] # Sypnia's second choice for the same kind of task
instructions = """
You answer questions about La Espiga's products using only the product data you are given.
If the data does not say, answer «I don't know, please ask at the counter».
"""
params = { temperature = 0.2, max_output_tokens = 250 }
tools = ["get_product"]
browser = true
limits = { end_user = { requests_per_day = 40 } }
safety = { moderation = "input", redact = ["email", "phone"] }| Field | What it does |
|---|---|
model | default (Cloud) or a catalog id: openrouter/…, bedrock/…, or local/<name> for a self-hosted endpoint |
fallbacks | models that take over, in order, when the first fails or is too slow (Fallbacks) |
instructions | text always placed first, as the system message. Callers can add their own after it, never replace it |
params | temperature, max_output_tokens, reasoning (low, medium, high for models that think before answering) |
output | a JSON schema file the answer must follow (Structured answers) |
tools | the tool names a caller may offer the model; others are refused |
browser | whether browsers may call this task with a browser token |
limits | per minute and caps in credits, for the task and for each person (Limits) |
safety | moderation (off, input, both) and redact (Content safety) |
store | days: 1 to 30 to keep what was asked and answered (Data and retention) |
cache | ttl for repeated identical calls (Caching) |
pin | keep the current model when Sypnia changes a default |
Changing routes
npx @sypnia/ai routes diff # what would change
npx @sypnia/ai routes apply # change it, after a confirmationApplying needs a person with the owner or admin role. Every change becomes a new version of the project’s routes, with who made it and when, and ai routes rollback --to <version> goes back. An agent can draft a change to the [ai] table of sypnia.toml; a person applies it.