MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / max_tokens_for_variant

Function max_tokens_for_variant

crates/opencode-server/src/routes.rs:2240–2249  ·  view source on GitHub ↗
(default_max_tokens: u64, variant: Option<&str>)

Source from the content-addressed store, hash-verified

2238}
2239
2240fn max_tokens_for_variant(default_max_tokens: u64, variant: Option<&str>) -> u64 {
2241 match variant.map(|v| v.trim().to_ascii_lowercase()) {
2242 Some(v) if v == "none" || v == "minimal" => 1024,
2243 Some(v) if v == "low" => 2048,
2244 Some(v) if v == "medium" => 4096,
2245 Some(v) if v == "high" => 8192,
2246 Some(v) if v == "max" || v == "xhigh" => 16384,
2247 _ => default_max_tokens,
2248 }
2249}
2250
2251async fn get_model_variant_lookup() -> &'static HashMap<String, HashMap<String, Vec<String>>> {
2252 MODEL_VARIANT_LOOKUP

Callers 1

stream_messageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected