Skip to main content

Crate llm_dialect

Crate llm_dialect 

Source
Expand description

llm-dialect: pure sans-I/O translation between LLM wire formats.

Parse an Anthropic (/v1/messages), OpenAI chat (/v1/chat/completions), or OpenAI Responses (/v1/responses) wire request into the canonical items model, flatten to the canonical ChatRequest an engine consumes (dialect::deflate), and render the engine’s responses/ streams back to the caller’s dialect ([dialect::*]).

The mapping is pure: no async runtime, no HTTP types in the public signatures, no wall clock, no randomness — ids and timestamps are supplied by the caller at the sanctioned factory boundaries. The optional axum feature adds the SSE pump (dialect::sse) and per-dialect stream Response shells for embedders that are an axum service.

Modules§

canonical
dialect
Wire-format dialect adapters.
error
Error type shared by every translation entry point.
items
Cross-dialect canonical representation.