# Agentic workloads

Agent systems often make several short model calls before they can continue:
routing, scoring, extraction, and query rewriting. The latency of those calls
accumulates across a workflow.

[celeris-1](/models#celeris-1) fits these steps well. For steps that need deeper
reasoning, use [celeris-1-magnus](/models#celeris-1-magnus).

## Patterns

### Classification and routing

Assign an input to a fixed set of labels, such as intent categories,
moderation states, or tools. Specify the allowed output values:

```json
{
  "model": "celeris-1",
  "messages": [
    {"role": "system", "content": "Choose exactly one tool: search, calculator, email, or none. Reply with that tool name only, without reasoning."},
    {"role": "user", "content": "what is 2 + 2?"},
    {"role": "assistant", "content": "calculator"},
    {"role": "user", "content": "what is 14% of 2,300,000?"}
  ],
  "max_tokens": 256
}
```

### Structured extraction

Extract typed fields from unstructured text. Request JSON, define the fields,
and set a token limit that fits the expected object:

```json
{
  "model": "celeris-1",
  "messages": [
    {"role": "system", "content": "Extract {name, company, intent}. Reply with one JSON object only, without commentary or fences. Example: 'Sam from Acme wants a demo' -> {\"name\":\"Sam\",\"company\":\"Acme\",\"intent\":\"demo\"}."},
    {"role": "user", "content": "Hi, Priya Nair here from Meridian Logistics — keen to trial the enterprise plan."}
  ],
  "max_tokens": 256
}
```

### Judging and scoring

Relevance grading, answer verification, and reranking generally use small
inputs and outputs, which makes them suitable for celeris-1.

```json
{
  "model": "celeris-1",
  "messages": [
    {"role": "system", "content": "Score how well the passage answers the question. Output one integer from 0 through 10 and nothing else. If the passage directly answers the question, output 10."},
    {"role": "user", "content": "Question: When did the Golden Gate Bridge open?\nPassage: The Golden Gate Bridge opened to pedestrians on May 27, 1937."}
  ],
  "max_tokens": 256
}
```

### Query rewriting

Turn conversational input into retrieval queries, SQL, or filter expressions:

```json
{
  "model": "celeris-1",
  "messages": [
    {"role": "system", "content": "Rewrite the message as a concise search query. Query only."},
    {"role": "user", "content": "hey do you have anything like the blue runners I bought last month but waterproof"}
  ],
  "max_tokens": 256
}
```

## Implementation guidance

- **Set `max_tokens` large enough for a complete tool call.**
- **Ask for machine-readable output** ("Reply with the tool name only", "JSON
  only") and validate it before use. Set
  [`response_format`](/making-requests#json-mode) rather than relying on the
  prompt for a JSON contract, and
  [`tool_choice: "required"`](/making-requests#tool-calling) (or a named
  function) to direct a call. A directed call is not guaranteed, so still
  confirm the reply carries `tool_calls`.
- **Parallelize independent calls within a concurrency limit.** This provides
  per-item failure handling without overwhelming the workspace's rate limit for the model.
  See [Rate limits](/rate-limits#backing-off-well).
- **Monitor `429` responses in your application.** They are not counted on the
  [usage page](/rate-limits#watching-your-usage). If the rate increases, reduce
  concurrency or [contact support](mailto:support@celeris.ai) about a higher
  sustained limit.
