Expand description
§graphrt-llm
Model providers and model-calling nodes for graphrt.
ChatModel: provider-neutral streaming chat interface.openai(featureopenai): any OpenAI-compatible endpoint.anthropic(featureanthropic): the Anthropic Messages API.ModelRegistry: named providers, registered as a host service.- Nodes:
llm,question-classifier,parameter-extractorandagent(a tool-calling loop overgraphrt_core::tool::ToolRegistry).
let mut registry = graphrt_core::Registry::with_builtins();
graphrt_llm::register(&mut registry);
let models = graphrt_llm::ModelRegistry::from_env()?;
let services = graphrt_core::Services::new().with(models);Re-exports§
pub use error::LlmError;pub use registry::ModelRegistry;pub use types::ChatDelta;pub use types::ChatModel;pub use types::ChatRequest;pub use types::ChatResponse;pub use types::ChatStream;pub use types::ContentPart;pub use types::FinishReason;pub use types::InvalidToolArguments;pub use types::Message;pub use types::ResponseFormat;pub use types::Role;pub use types::ToolCall;pub use types::ToolChoice;pub use types::collect;
Modules§
- anthropic
- Anthropic Messages API provider (streaming, tool use, extended thinking).
- credential_
config - Declarative provider credentials: build providers whose keys come from a
CredentialSourceinstead of a static API key. - credentials
- Dynamic credentials for model providers.
- error
- Model errors and their mapping to node errors.
- failover
- Failing over to fallback models when a provider is down.
- mock
- Scripted model for tests and offline examples (feature
mock, on by default). Scripted model for tests and offline examples. - nodes
- Model-calling nodes.
- openai
- OpenAI-compatible chat completions provider.
- providers
- Config-driven model providers.
- registry
- Named model providers, registered as a host service.
- replay
- Record / replay provider for deterministic runs (feature
replay). Record and replay model responses (“cassettes”) for deterministic runs. - sse
- Minimal Server-Sent Events parser.
- types
- Provider-neutral chat types.
- typesafe
- Client for TypeSafe’s System One decision API (model family “Jev”).
Functions§
- prewarm_
http_ client - Builds the providers’ shared HTTP client (default connect timeout) now, on a background thread, instead of in the first model call: for a process started because a run is on its way (an agent woken by a gateway), the trust store loads alongside its start-up instead of before the first token. A build error is kept and reported by the first call, as without it.
- register
- Register the
llm,question-classifier,parameter-extractorandagentnode kinds.