Skip to content

Tasks and routes

The built-in tasks, your own tasks, and every field of a route in sypnia.toml.

Applies to EngineCloud
View as Markdown
On this page
  1. The built-in tasks
  2. Your own tasks
  3. Asking for a task
  4. Every field of a route
  5. Changing routes

The built-in tasks

TaskFor
chata conversation with a person of your app
writeshort texts: a message, a description, an e-mail
codereading and writing code (Sypnia Agent uses it)
summarizea long text or a set of facts into a few sentences
extractdata out of text, as JSON that follows your schema
classifyone label out of a list: «question», «complaint», «order»
visionreading images and documents
embedturning 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

JSON
{ "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.

sypnia.toml
[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"] }
FieldWhat it does
modeldefault (Cloud) or a catalog id: openrouter/…, bedrock/…, or local/<name> for a self-hosted endpoint
fallbacksmodels that take over, in order, when the first fails or is too slow (Fallbacks)
instructionstext always placed first, as the system message. Callers can add their own after it, never replace it
paramstemperature, max_output_tokens, reasoning (low, medium, high for models that think before answering)
outputa JSON schema file the answer must follow (Structured answers)
toolsthe tool names a caller may offer the model; others are refused
browserwhether browsers may call this task with a browser token
limitsper minute and caps in credits, for the task and for each person (Limits)
safetymoderation (off, input, both) and redact (Content safety)
storedays: 1 to 30 to keep what was asked and answered (Data and retention)
cachettl for repeated identical calls (Caching)
pinkeep the current model when Sypnia changes a default

Changing routes

Terminal
npx @sypnia/ai routes diff      # what would change
npx @sypnia/ai routes apply     # change it, after a confirmation

Applying 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.

  1. The built-in tasks
  2. Your own tasks
  3. Asking for a task
  4. Every field of a route
  5. Changing routes

    Search pages, sections and terms