@wrongstack/webui 0.250.0 → 0.255.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3303,6 +3303,14 @@ async function startWebUI(opts = {}) {
3303
3303
  try {
3304
3304
  const m = await modelsRegistry.getModel(config.provider, config.model);
3305
3305
  maxContext = m?.capabilities?.maxContext ?? 0;
3306
+ if (!maxContext) {
3307
+ try {
3308
+ const provider2 = await modelsRegistry.getProvider(config.provider);
3309
+ const rawModel = provider2?.models.find((mod) => mod.id === config.model);
3310
+ maxContext = rawModel?.limit?.context ?? 0;
3311
+ } catch {
3312
+ }
3313
+ }
3306
3314
  const rates = getCostRates(m);
3307
3315
  inputCost = rates.input;
3308
3316
  outputCost = rates.output;