Features
What Freyja does today, and what it does not. The second list matters as much as the first, so it is on the same page rather than hidden.
What works
Talking to models
| Text generation | Yes, on every provider |
| Images in a prompt | Yes, by URL or data: URI |
| System instructions | Yes, placed correctly per provider automatically |
| Model selection | Yes, or leave it unset and take the endpoint's default |
| Sampling controls | max_tokens, temperature, top_p |
| Reasoning effort | Yes, on every dialect; a level a vendor lacks is that vendor's rejection |
| Asking before sending | Client::check, no network call and no key used |
| Structured output | JSON schema, and free JSON where the provider offers it |
| Typed responses | generate_as::<T>() deserializes for you, see Typed output |
| Strict-mode schemas | strict_schema() rewrites a schema into the subset OpenAI accepts |
| Vendor-only fields | extra_for(), scoped to a dialect so the request stays portable |
| Token accounting | Yes, normalized across providers |
| Streaming | Yes, on every dialect, see Streaming |
Streaming delivers the same answer incrementally, and a drained stream converts back into the same GenerateResponse, so a streamed send runs the same loop as a plain one. Tool-call arguments and reasoning blobs are assembled for you and surface only once complete, so nothing stitches partial JSON.
Building agents
| Declaring tools | Yes, with JSON Schema parameters |
| Typed tool functions | #[tool] derives the schema and JSON executor from a sync or async function |
| Constraining tool choice | Auto, none, required, or a named tool |
| The full tool round trip | Yes, verified against live APIs, not just tested offline |
| Multi-turn conversations | Yes, transcripts are plain data you own |
| Reasoning state replay | Handled for you, see Concepts |
| Group-aware trimming | window_by_groups is public, so a Memory of your own applies the same rule Window::last does |
| Token-budget trimming | window_by_tokens is public, so a Memory of your own applies the same rule Window::tokens does, given a TokenCounter |
| Summarizing dropped turns | Summarizer is public, so a Memory of your own can summarize what it trims inside its own recall, the way Window::summarize does |
| Token estimation | HeuristicCounter, a dependency-free estimate that counts media by what it shows, or any Fn(&Message) -> usize + Send closure wrapping a real tokenizer |
| Automatic loop orchestration | Agent runs the tool-calling loop for you and dispatches parallel tool calls concurrently, eight at a time |
| Hooks | Agent::hook takes a Hook that sees every model call and tool call and can end the run, see Hooks |
| Tracing and run spans | The tracing feature adds the Tracing hook and a run span per run, see Observability |
| Token budgets | Agent::token_budget ends a run with StopReason::OverBudget, see Observability |
| Record and replay | ScriptedModel scripts answers, usage and failures, Cassette records a real run once and replays it after, and HashEmbedder tests retrieval, all with no key, see Testing |
| Pause and resume | A guard answers Decision::Ask, and Conversation::resume carries on, even after a restart, see Human approval |
| Agents as tools and teams | Agent::into_tool lends work to another agent, and Team hands a conversation over, see Multi-agent |
| Refusing a tool call | Agent::guard vets every requested call, and a refusal reaches the model as text it can act on |
| Tools that hold state | Implement Tool on a struct; its fields are per-agent state |
| Per-run data in a tool | Context is handed to every call and never sent to the model |
| Tools defined at runtime | name and definition are values, so an MCP-shaped tool needs no compile-time type |
| Tools that fail | A Result return reaches the model as error text it can recover from |
| Choosing what the model sees | Agent::memory takes a Memory, which works with any Storage and leaves every stored turn in place. Window::last keeps pinned turns and the most recent turns |
| Bounding a transcript by token budget | Window::tokens keeps pinned turns and the most recent turn groups fitting an estimated budget |
| Summarizing what a window drops | Window::summarize sends one summary message in place of the turns its window drops, made by a Summarizer at half the window and reused until the window needs to drop more. Conversation::summary reads it and Conversation::compact makes one now |
| A conversation that survives a restart | JsonlStorage::open(path) keeps one conversation in a file, one JSON record per line, as a pure store, and keeps the state slot, so a summary survives the restart too |
| A conversation in a database | The freyja-sqlx crate's PgStorage, MySqlStorage and SqliteStorage keep many conversations in Postgres, MySQL or SQLite, in two tables, with the state slot. It is a separate crate, so the core compiles no database driver. See Storage |
| Storage written elsewhere | Storage is three required methods over public types, so a third-party crate implements it with no change here, and freyja::testing::storage_conformance checks it, and may cut anywhere it likes, because the repair pass drops both halves of a pair the cut separated |
| Embeddings and search by meaning | Client::embed turns text into vectors on OpenAI-compatible endpoints and Gemini, and Anthropic refuses it with UnsupportedCapability. An Index searches texts by meaning, in memory or in any VectorStore, such as the freyja-sqlx crate's PgVectorStore for Postgres with pgvector, and Index::into_tool hands that search to an agent. See Embeddings and Retrieval |
| Tools from MCP servers | The freyja-mcp crate connects to a server over stdio or Streamable HTTP and hands its tools to an agent, with guards and hooks applying as they do to any tool. See MCP servers |
The round trip is the load-bearing feature. A model asks for a function, you run it, you feed the result back, and it continues. Building an agent is the tutorial and Agents the guide.
Reaching providers
| Built-in | OpenAI, Google Gemini, Anthropic |
| Wire dialects | Four, including the format most third-party vendors copy |
| Any other endpoint | One Client::custom call, no code change |
| Non-conventional URLs | path replaces the dialect's path, query pins parameters on every request |
| Credentials in the URL | Auth::Query for an endpoint that takes its key as ?key=, kept out of url(), as is any secret_query value |
| Local runtimes | Yes, no credentials required |
Built-in means Freyja ships and tests the URL and default model. It does not mean the others are second class: DeepSeek, Groq, OpenRouter, Ollama, and a long tail of others work through Custom providers with the same code paths.
Operational
| Connection pooling | One HTTP client per Client, reused |
| Timeouts | 120 seconds of inactivity by default, or supply your own HTTP client |
| Errors | Classified by cause, each attributed to the endpoint that failed |
| Retrying a failed call | Retry tries it again, deciding with is_retryable() and waiting the endpoint's own Retry-After, clamped to error::MAX_RETRY_AFTER. See Handling outages |
| A second model when the first is down | Fallback::new(primary, backup) falls over on a rate limit, a server error, a dropped connection, an unreachable endpoint or a spent quota. See Handling outages |
| Half price for work that can wait | Client::submit_batch sends a batch to OpenAI or Anthropic, batch and batch_results read it back within 24 hours |
| Untrusted endpoints | A redirect is followed only within one origin, and body, stream, frame, Retry-After and tool fan-out all have ceilings |
| Credential safety | Debug redacts the API key, secret_header and secret_query extend that to a second credential in Debug, error messages and url(), and every credential header goes out marked sensitive |
| Dependencies | reqwest, serde, serde_json, schemars, and freyja-macros |
What does not exist yet
Be sure none of these is on your critical path before adopting.
| Status | Workaround | |
|---|---|---|
| Per-tool timeouts | Out of scope, deliberately | Racing a call against a clock needs a timer, and Freyja depends on no runtime. A wrapper tool that holds the inner one and applies your runtime's timeout gets there in a dozen lines, for a tool you did not write as much as one you did. The Tool documentation has the whole implementation. |
| Structured-output schema derivation | Not implemented | #[tool] derives argument schemas, but ResponseFormat::JsonSchema still takes an explicit schema. Generate one with schemars and pass it through strict_schema(). |
| Capability tables | Not planned | Client::check answers the same question by running the conversion, so there is nothing to keep in sync. It needs a request in hand, which a table would not. |
Per-provider gaps
Capability coverage is not uniform, and Freyja refuses rather than pretending.
| Capability | OpenAI | Gemini | Anthropic | Chat Completions |
|---|---|---|---|---|
tool_choice | Yes | Yes | Yes | Yes |
reasoning_effort | Yes | Yes | Yes | Yes |
response_format | Yes | Yes | Schema only | Yes |
previous_response_id | Yes | Yes | No | No |
metadata | Yes | Yes | Yes | Yes |
A No means UnsupportedCapability before any network call, so you find out immediately rather than getting an answer that ignored you. Each provider page has the full table.
A Yes means Freyja can express it, not that every model will accept every value. Only the dialect is known here; the endpoint and the model are not. reasoning_effort is the clearest case, OpenAI's Responses API takes Max and its Chat Completions API does not, on the same model, and both arrive as the vendor's own BadRequest rather than as a refusal from Freyja.
The table has no middle column for "carries it but the endpoint says no", deliberately. Gemini rejects three thinking_level values and rejects labels outright; both fields exist, so both requests are sent and the endpoint answers. Freyja refuses a field only when the format has nowhere to put it, anything narrower is a claim about a deployment on a given day. See Gemini.
Verification status
Freyja distinguishes "the tests pass" from "a real vendor accepted it", because the two came apart once already and cost three bugs.
| Endpoint | Live tool round trip |
|---|---|
| OpenAI | Yes |
| Gemini | Yes |
| Anthropic | Yes |
| A Chat Completions endpoint (DeepSeek) | Yes |
Beyond text and tool calling, coverage is uneven and worth reading closely.
| Capability | Live coverage |
|---|---|
| Reasoning effort | OpenAI, both dialects, every level; Gemini, all six levels |
| Chat Completions token cap | Both spellings |
| Structured output | OpenAI and Gemini: nested struct, enum, Option, Vec, through generate_as |
| Streaming, text | All four dialects, deltas, usage on Done, and into_response parity |
| Streaming, tool calls | None. The assembler joining argument fragments is fixture-only |
| Images | An image_url part accepted live on OpenAI Chat Completions, on every role. Not exercised on the other three |
| Reasoning effort on Anthropic | None |
| Structured output on Anthropic | None |
Two entries deserve their asterisks. The Anthropic dialect's live runs go through a compatible endpoint rather than Anthropic's own service, which covers the wire format and not the vendor. And streamed tool calls are the part of streaming most likely to differ between vendors, since that is where fragments are joined, so the one path with no live coverage is also the one that would benefit most.
That unevenness is not incidental. Sending Gemini a temperature was rejected outright until it was tried, and the offline tests had asserted the wrong shape for as long as they existed. Each dialect's streaming frames are taken from the vendor's own documentation and tested against recorded fixtures, including a test per dialect asserting that a drained stream matches what generate builds from the same turn.