Skip to main content

infr_engine/
lib.rs

1//! Chat text logic re-exports shared by `infr run` and `infr serve` (prompt rendering,
2//! channel/tool-call parsing, the reasoning/content delta splitter). The load-pipeline/session
3//! orchestration this crate originally stubbed out (the `Engine` struct) is now the unified
4//! transformer runner in `infr-llama` (`SeamModel` + the per-backend `ChatModel` impls, see
5//! `docs/diffusion-gemma.md` and `docs/qwen35.md`) — every arch, including DiffusionGemma, is built
6//! on it, so there is no separate "engine" seam left to implement here.
7//!
8//! Reference for chat/channel/tool behavior: `~/Projects/scratch/dgemma-openai-server.py`.
9
10// Chat text logic (prompt rendering, channel/tool-call parsing, message types) lives in the shared
11// `infr-chat` crate so backends and the server share ONE implementation. Re-exported here for the
12// existing `infr_engine::{ChatMessage, …}` call sites.
13pub use infr_chat::{
14    parse_hermes_tool_calls, parse_tool_calls, split_channels, split_reasoning, split_think,
15    ChatMessage, ToolCall,
16};
17
18/// A streamed piece of a response (re-exported from the single splitter in `infr-chat`).
19pub use infr_chat::{prompt_prefills_think, ChatStream, Delta};