pub struct RoutedModelConfig {
pub routes: HashMap<ModelHint, String>,
pub default_model: String,
pub api_key: String,
pub base_url: String,
}Expand description
Maps ModelHint values to concrete model names.
Hints not present in the map fall back to default_model.
Fields§
§routes: HashMap<ModelHint, String>hint → model_name mapping
default_model: StringModel used when no hint matches or hint is None
api_key: StringAPI key shared across all routed models
base_url: StringBase URL shared across all routed models
Implementations§
Source§impl RoutedModelConfig
impl RoutedModelConfig
Sourcepub fn resolve(&self, hint: Option<ModelHint>) -> &str
pub fn resolve(&self, hint: Option<ModelHint>) -> &str
Resolve a hint to a concrete model name.
Returns default_model when hint is None or not in the routes map.
Sourcepub fn dual(api_key: String, thinking: String, execution: String) -> Self
pub fn dual(api_key: String, thinking: String, execution: String) -> Self
Convenience constructor for the common two-model case.
Routing strategy:
- Thinking → thinking model (pro): first-iteration understanding, stuck-detection re-planning, complex reasoning.
- Recovery → thinking model (pro): after a tool error, the model needs to diagnose what went wrong — real reasoning work.
- Execution → execution model (flash): the steady-state of most turns — processing tool results, issuing shell/edit commands. Flash is fast and cheap; if it makes a mistake, pro catches it on the next iteration via Recovery.
- Summarization → execution model (flash): compressing already- resolved history is purely mechanical.
- Default → flash: when no model_hint is set, use the fast path.
If a single model is specified (--model deepseek-v4-pro) the
RoutedProvider is skipped entirely and all calls go to that model.
Sourcepub fn with_base_url(self, url: String) -> Self
pub fn with_base_url(self, url: String) -> Self
Set a custom base URL (e.g. for self-hosted or proxy endpoints).
Trait Implementations§
Source§impl Clone for RoutedModelConfig
impl Clone for RoutedModelConfig
Source§fn clone(&self) -> RoutedModelConfig
fn clone(&self) -> RoutedModelConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RoutedModelConfig
impl RefUnwindSafe for RoutedModelConfig
impl Send for RoutedModelConfig
impl Sync for RoutedModelConfig
impl Unpin for RoutedModelConfig
impl UnsafeUnpin for RoutedModelConfig
impl UnwindSafe for RoutedModelConfig
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