| 2238 | } |
| 2239 | |
| 2240 | fn 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 | |
| 2251 | async fn get_model_variant_lookup() -> &'static HashMap<String, HashMap<String, Vec<String>>> { |
| 2252 | MODEL_VARIANT_LOOKUP |