Repository navigation
Rig v0.44.0 released! #2759
gold-silver-copper
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
68 PRs closed since 0.43 . Excluding test fixtures, the tag-to-tag diff is +149k/−196k lines, so Rig got smaller while gaining a model catalog, typed options for every provider, citations and cost. The cassette corpus went from 3,012 to 874 recordings with no loss of measured coverage (more on that below). Big thank you to all our contributors 🫡
0.44 highlights:
reasoning,cache,service_tier,verbosity,parallel_tool_calls,seed,top_pandstopare one typed, portable value. Every provider wire maps each option or refuses it out loud, so an option is never silently dropped.Usagenow carries a cost in USD where one is known.completion()defaults to each provider's OpenAI-compatible API;Ollama::native_completionkeepsnum_ctx,keep_aliveandthink, and Cohere'sChatRoute::Native/Autokeeps documents, citations andtool_plan.Typed Generation Options
Before 0.44, turning on reasoning or prompt caching meant writing a different JSON shape for every provider in
additional_params, or finding the provider's own setter. Get the shape wrong and the provider usually ignored it. Now there is one value,GenerationOptions, with a setter for each field onCompletionRequest,AgentBuilderandAgentRunner.Every completion wire must answer for every option: it either maps the option to its provider's JSON, or refuses it. A refusal is
ProviderError::UnsupportedOption, raised before anything is sent. If you'd rather skip what a model can't take,.on_unsupported(OnUnsupported::Ignore)turns the refusal into one warning. A request that sets no options skips these checks. Some request bodies still change in 0.44 (raw-parameter merging, catalog-driven image and token rules); the migration guide lists them.Request bodies are now built in one place, merged in a fixed order: the wire's encoding, then the typed options, then provider options, then
additional_params. Precedence is therefore the same on every provider, andadditional_paramsoverrides everything except a few fixed protocol rewrites such asstream.The Model Catalog
rig::catalogships with Rig. It is built from models.dev and hand-reviewed for the main providers. EachModelSpecrow records the model's context window and output limit, what it accepts as input, its reasoning levels and budgets, its cache retention, whether it supports tools and structured output, and its price.ModelSpec::validatechecks options against a model before you send anything.AgentBuilder::model_specchecks every call an agent makes.providers::registry::connectbuilds a model straight from a catalog row or avendor/modelreference.connectserves every provider rig-core ships; Bedrock, Vertex AI and Gemini gRPC rows name their own crate (ConnectError::CatalogOnly). The catalog is kept in step with models.dev bycargo xtask catalog sync, and a guard test fails CI if any public model constant in Rig has no catalog entry.Provider Extensions: Typed Options and Typed Replies
Everything a provider offers beyond the portable options is now typed, in each provider's
extensionmodule (providers::<provider>::extension, orrig_bedrock::extensionand friends for the companion crates). That includes OpenRouter's model fallbacks and routing, Anthropic's context management, Gemini'sgenerationConfig, Bedrock's guardrails, and more.provider_option(..)attaches a provider's options. One request or agent can carry options for several providers at once, and each wire sends only its own entry. That makes it safe to switch providers at runtime.extras::<P>()andextras_lossy::<P>()read a provider's typed reply fields. They read the same way from a unary or a streamed reply, because a streamed reply'srawis now rebuilt into the same document the unary API returns.Extensions cover Anthropic, OpenAI (Chat and Responses), Azure, ChatGPT, Copilot, OpenRouter, DeepSeek, xAI, Mistral, Groq, Together, Venice, llama.cpp, Perplexity, Ollama, Cohere, Gemini (GenerateContent and Interactions), Z.AI, MiniMax, Moonshot, Xiaomi MiMo, Bedrock, Vertex AI, Gemini gRPC and Candle. Provider keys such as
"gcp.gemini"and"aws_bedrock"are now stable API.Citations and Cost
Citations used to be buried in each provider's native JSON. Now
Text::citations()gives you a checked span of the answer and the sources behind it, from every provider that cites:Usage::cost(anOption<Cost>, in USD) uses the provider's own figure when it reports one (OpenRouter, Perplexity, xAI, Venice). Otherwise it is estimated from the catalog's standard-tier list prices, so treat it as an estimate rather than the bill. ChatGPT, Copilot, Ollama and unpriced models get no cost.Tool Calls Stream as They're Written
In 0.43, a streamed tool call arrived in one piece when it closed. In 0.44, its arguments stream fragment by fragment, as the provider sends them. Anthropic and every Messages-format dialect now ask for eager tool-input streaming, so a long argument such as a file being written trickles in instead of landing in one burst. OpenAI Responses forwards argument deltas live too.
on_tool_call_deltafires for every fragment, with the text so far inaggregated, andparse_partial_argumentsturns incomplete JSON into a best-effort object that never fails:The new
examples/agent_tool_call_streamingexample shows a full agent doing this. It can also stop a run partway through a call, before the tool ever executes.History That Knows Where It Came From
Assistant history is now item-shaped. Each
AssistantMessagerecords itsorigin(which provider and model wrote it) and itsstop, and every block keeps the provider item it came from. Before each request,history::adaptshapes the history for its target:AssistantContent::Opaqueinstead of failing the reply or vanishing.This closed a long tail of history, replay and decoding bugs across providers (#1559, #1508, #1962, #2201, #2244, #2647, #2668, #2703, …).
No more silent failures. A turn that ends with an unknown finish reason, filtered content or a reported failure used to come back as a success, and then disappeared from history on the next turn. Now it fails the run with an error naming the raw reason. If your provider sends finish reasons Rig doesn't know, opt in with
.accept_unknown_finish_reasons(true)on the agent, the run or the request.Native Ollama and Cohere Routes
In 0.43 both
completion()constructors used the native APIs. In 0.44 they default to the OpenAI-compatible APIs, and the native routes are opt-in.Ollama:
Ollama::native_completiontalks to the daemon's own/api/chat, wherethink,keep_aliveand model options such asnum_ctxactually reach the model. An inline<think>block is split out as reasoning, whole or streamed.Ollama::completiontargets the OpenAI-compatible/v1, and now refusesnum_ctxinstead of silently ignoring it.Cohere: with
ChatRoute::Auto, requests that carry documents go to/v2/chat, and the answer comes back with citations and thetool_plan, which round-trip through history.ChatRoute::Nativekeeps a whole conversation there.A Smaller, Sharper Test Corpus
0.43 grew the cassette corpus to about 3,000 recordings. This cycle, a new coverage gate (#2720) measures what the corpus actually proves:
cargo xtask cassette prunethen kept the fewest tests that still cover all of it. That deleted 3,352 provider tests, 2,121 fixtures and 1,831 effect goldens, with every deletion listed alongside the kept tests that cover it. Fixtures that are kept have their request bodies checked against snapshots on every replay.Providers and Models
GEMINI_3_8_FLASHandDEEPSEEK_FLASH.Quirks::done_without_finish_reasonhandles streams that end with[DONE]but nofinish_reason.eos,end_turnandstop_sequenceare a normal stop on every Chat dialect.like,similar_toandbetweenbind their values as parameters. A$inside a key no longer shifts every later placeholder.gen_ai.operation.namewithgen_ai.request.streaminstead ofchat_streaming, so dashboards keyed onchat_streamingneed updating. Thanks to @mateobelanger.Upgrading
0.44 is a breaking release. The most common changes:
response.outputis nowresponse.output().StreamingErroris folded intoPromptError, with shorter variant names.MultiTurnStreamItem::ToolResult.ToolDefinition::nameis aToolName.CompletionRequestandUsageare built with constructors.CompletionResponse'sprovider,model,response_idandmessage_idfields are gone: useprovider(),model()andresponse_id().Reasoningis{ text, redacted, native }; its helper constructors and theSealedwrapper are gone.deepseek::CompletionResponse) are gone; read reply fields withextras::<P>().VectorStoreIndex::top_nreturns namedVectorSearchResults instead of tuples.UserContent::audio/video/documentareaudio_base64/video_base64/document_text.with_prompt_cachingsetters became.cache(CacheRetention::…); Anthropic's explicitwith_prompt_cachingstays. Bedrock'swith_guardrailbecameBedrockOptions::guardrail.completion::.Ollama::completionnow targets/v1. Usenative_completionto stay on/api/chat.Cohere::completionnow defaults to the Compatibility API. SetChatRoute::Native(orAutofor requests with documents) to keep citations,tool_planand documents.Some changes compile but behave differently: a text answer with an unknown finish reason fails the run,
additional_paramsnow overrides typed fields and merges key by key, models the catalog lists without image input get a text placeholder, andUsageandTextequality now includecostandcitations.The 0.43 → 0.44 migration guide covers every break with before/after code, including the changes that compile but behave differently.
Huge thank you to everyone who made 0.44 happen:
We build Rig, Rig builds us!
Full changelog: v0.43.0...v0.44.0
All reactions