Expand description
Provider and model system.
Loads a built-in model catalog from models.json in this directory,
overlays user overrides from ~/.rab/agent/models.json,
and provides the right StreamProvider for each model’s API protocol.
Modules§
- anthropic
- Custom Anthropic Messages API provider that uses
model_config.base_urland forwardsmodel_config.headers— unlike yoagent’s AnthropicProvider which hardcodeshttps://api.anthropic.comand ignores headers. - compat
- Rich compatibility flags matching pi’s OpenAICompletionsCompat structure.
Deserialized from the
compatfield in models.json, then serialized intoModelConfig::headers["_rab_compat"]for our custom provider to read. - generate_
models rab generate-modelssubcommand.- models
- models.json — parses built-in and user models.json files and constructs yoagent ModelConfigs with rich compat stored in headers.
- oauth
- OAuth provider trait and registry — matching pi’s OAuthProviderInterface.
- openai_
compat - Custom OpenAI-compatible streaming provider with pi-level compat support.
Structs§
- Provider
Registry - The provider registry — holds all known providers and their models.
- Resolved
Model - A resolved model ready for use by the agent.
Functions§
- calculate_
cost - Calculate the USD cost components of a usage record given a model’s cost config.
- get_
agent_ dir - Get the agent config directory (~/.rab/agent).