Repository navigation
Releases
v0.6.1
Built on reqwest 0.13 and reqwest-middleware 0.5: a client you pass to with_http_client or LLMClient::with_client has to come from those versions now, and the reqwest types this crate exposes are 0.13's. The shared client keeps the TLS it had (ring, the built-in Mozilla roots, HTTP/2). See CHANGELOG.md.
v0.6.0
One simple way to ask, translated per provider. Only what you set is sent; max_tokens counts reasoning and answer together (Anthropic, which requires a cap, gets the model's largest output, or 4096); reasoning is unset, Off, or On(effort) with the effort sent as written. What the library knows about a model is one ModelInfo (price, largest output, context window), given by you or looked up by the provider, and it drives estimates, the price of token-only calls and Anthropic's cap. Every billed response is reported, retries are off by default, a request's timeout is one deadline, and long streams are no longer cut off after ten minutes. Anthropic now takes images and PDFs. The Claude subscription preset is removed. Breaking changes; see CHANGELOG.md for the full list.
v0.5.11
Reasoning is translated per wire instead of written as OpenRouter's object everywhere, and "off" (effort: "none") never fails a request. OpenRouter keeps the object verbatim; OpenAI and generic servers get reasoning_effort (off writes nothing); Anthropic gets thinking at last: a budget on Claude 4.5 and earlier, adaptive plus output_config.effort from 4.6 on, off writing nothing on every model. New Provider::openai_reasoning_value hook. See CHANGELOG.md for details.
v0.5.10
Fixed
- Sampling parameters (
temperature,top_p,frequency_penalty,presence_penalty,repetition_penalty) andVideoData.frame_rateare nowf64instead off32. These values reach the wire as JSON numbers, and an f32 0.9 widens to0.8999999761581421on serialization; providers that cap the number of decimals (Z.AI allows two on temperature) rejected the request with a 400.f64carries the value the caller wrote, verbatim.
v0.5.9
Native PDF/document attachments: DocumentData media type, ContentPart::File (OpenAI-compatible type:"file" wire part, translated by OpenRouter for downstream providers), honest filename derivation, per-page cost estimation with page_count metadata, live-verified against OpenRouter. See CHANGELOG.md for details.
v0.5.8
Returned media: media the model generates (image output) lands on CompletionResponse::media as the same typed Media the request side uses, parsed through the new per-provider Provider::parse_response_media hook (default: the OpenAI-wire message.images field), with to_assistant_message() as the canonical response-to-history conversion. Audio parts holding data: URLs normalize to raw base64 + format at wire time. The provider module is restructured one-file-per-provider with the shared OpenAI dialect as the public provider::openai_wire module, and every wire projection moved off the normalized types into the wire that owns it. See CHANGELOG.md.
v0.5.7
Media estimation metadata rides tolerant wires: image/video parts carry pixel dimensions (with_dimensions) next to the existing clip durations; the provider impl decides whether the metadata rides the request payload (Provider::wire_keeps_estimation_metadata, default false). OpenRouter keeps it (it normalizes requests before forwarding, verified against OpenAI- and Anthropic-served models), so an in-flight meter can price media exactly from the request bytes. The pre-send estimator tile-prices stills with declared dimensions, under the unknown-size flat bound. See CHANGELOG.md.
v0.5.6
Injected HTTP client seam: LLMClient::with_client / GeneratorInfo::with_http_client (plain reqwest::Client or ClientWithMiddleware); every request a generator makes rides it. Streaming moves off reqwest-eventsource (no silent reconnect-replay) to SSE parsing over the response byte stream; the idle timeout also bounds the wait for the response to start; out-of-band cost queries use the generator's client. See CHANGELOG.md.
v0.5.5
Fixed
- The crate forced a native-TLS (OpenSSL) dependency on every consumer: its
reqwestused default features, so a consumer building in a slim container (no OpenSSL dev headers) failed to compile. It now uses rustls, which needs nothing from the system.
v0.5.4
Added
GeneratorInfo::with_base_url: point a generator at a different address (a gateway, a proxy, a self-hosted endpoint). Every request the crate makes for that generator goes there.
Fixed
- The OpenRouter cost lookup (
/generation) hardcodedopenrouter.ai, so a generator pointed at a gateway resolved its costs past the gateway. It now uses the generator's own address, like every other request. PostStreamCtxcarriesbase_urlinstead of assuming the provider's host (affects only code implementing theProvidertrait).