Module normalize

Module normalize 

Source
Expand description

Universal local-LLM consistency layer.

This module rewrites model-specific output dialects into the strict OpenAI-shaped crate::domain::agent::LlmStreamEvent sequence that the rest of the codebase expects. Adapters wrap the LLM stream once at the port boundary; every downstream surface (Axum, CLI, Tauri, proxy) consumes the canonical form.

§Module map

§Adding a new dialect

  1. Add a pub const FORMAT_* to tags.
  2. Drop a new file under parsers.
  3. Add one match arm to registry::get_parser.

The registry is the only place that knows the full set of parsers, by design — see the module docs there.

Re-exports§

pub use error::NormalizationError;
pub use error::NormalizationErrorKind;
pub use history::strip_thinking_debt;
pub use parser::ParserOutput;
pub use parser::ToolCallParser;
pub use registry::get_parser;
pub use stream::NormalizingStream;

Modules§

error
Non-fatal error reporting from normalization parsers.
history
Cross-turn “thinking debt” removal for chat history.
parser
The ToolCallParser trait and its companion ParserOutput.
parsers
Submodule index for concrete super::parser::ToolCallParser implementations.
registry
Tag-driven parser dispatch.
stream
NormalizingStream — the single wrap point that canonicalises an LLM event stream.
tags
Format-tag constants used to select a normalization parser.