pub struct ModelRegistry { /* private fields */ }Implementations§
Source§impl ModelRegistry
impl ModelRegistry
Sourcepub fn load() -> Self
pub fn load() -> Self
Load from ~/.rho/models.toml, merging with built-ins.
User configs override built-ins by id.
pub fn get(&self, id: &str) -> Option<&ModelConfig>
pub fn list(&self) -> &[ModelConfig]
Sourcepub fn to_model(config: &ModelConfig) -> Model
pub fn to_model(config: &ModelConfig) -> Model
Convert a ModelConfig to the runtime Model type.
Sourcepub fn resolve_api_key(config: &ModelConfig) -> Result<String, String>
pub fn resolve_api_key(config: &ModelConfig) -> Result<String, String>
Resolve the API key for a model config.
Resolution order:
api_key_envenv var (if set and non-empty)anthropic-authkeychain / OAuth (for Anthropic provider only)"local"(for localhost/127.0.0.1 base URLs — e.g. Ollama)- Error
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ModelRegistry
impl RefUnwindSafe for ModelRegistry
impl Send for ModelRegistry
impl Sync for ModelRegistry
impl Unpin for ModelRegistry
impl UnsafeUnpin for ModelRegistry
impl UnwindSafe for ModelRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more