pub struct ModelMapping {
pub id: String,
pub channel_id: String,
pub client_name: String,
pub upstream_name: String,
pub billing: String,
pub pricing_json: String,
pub weight: u32,
pub enabled: bool,
pub protocols: String,
}Expand description
Maps a client-facing model name to an upstream model name with pricing.
Fields§
§id: StringUnique mapping identifier.
channel_id: StringThe channel this mapping belongs to.
client_name: StringModel name as seen by the client (e.g. “claude-sonnet”).
upstream_name: StringModel name sent to the upstream API (e.g. “claude-sonnet-4-7”).
billing: StringBilling model: “metered” or “flatfee”.
pricing_json: StringSerialized pricing configuration (JSON).
weight: u32Selection weight for weighted random (Phase 2). Default 100.
enabled: boolWhether this mapping is active.
protocols: StringProtocols this mapping is valid for (JSON array of strings).
Empty array [] means the mapping works with all protocols the channel
supports (backward compatible). When non-empty, only the listed protocols
are considered valid for this mapping — the router will bridge to a
compatible protocol when the client’s format does not match.
Example: '["openai_chat"]' constrains a mapping to the OpenAI Chat
protocol only, preventing the router from forwarding requests via
anthropic_messages when the upstream model does not support that
protocol.
Trait Implementations§
Source§impl Clone for ModelMapping
impl Clone for ModelMapping
Source§fn clone(&self) -> ModelMapping
fn clone(&self) -> ModelMapping
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more