free-coding-models 0.5.69 → 0.5.71

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.
@@ -3300,13 +3300,13 @@ class RouterRuntime {
3300
3300
  // 📖 identical (tier, sweScore, latency) - never a hard requirement, so
3301
3301
  // 📖 a user whose NVIDIA key is dead still gets a working set.
3302
3302
  const PREFERRED_DEFAULT_MODELS = [
3303
- { provider: 'groq', model: 'llama-3.3-70b-versatile' },
3304
3303
  { provider: 'groq', model: 'openai/gpt-oss-120b' },
3304
+ { provider: 'groq', model: 'qwen/qwen3.6-27b' },
3305
3305
  { provider: 'cerebras', model: 'llama3.1-70b' },
3306
- { provider: 'nvidia', model: 'deepseek-ai/deepseek-v4-flash' },
3306
+ { provider: 'nvidia', model: 'deepseek-ai/deepseek-v4-flash-0731' },
3307
3307
  { provider: 'cerebras', model: 'qwen-3-235b-a7b' },
3308
3308
  { provider: 'nvidia', model: 'openai/gpt-oss-120b' },
3309
- { provider: 'groq', model: 'llama-3.1-8b-instant' },
3309
+ { provider: 'groq', model: 'openai/gpt-oss-20b' },
3310
3310
  { provider: 'nvidia', model: 'minimaxai/minimax-m2.7' },
3311
3311
  ]
3312
3312
 
@@ -3424,6 +3424,12 @@ export async function buildDefaultRouterSet(config = {}, maxModels, options = {}
3424
3424
  // 📖 Build the final order: proven-working models first, then the static
3425
3425
  // 📖 fallback, then pinned popular models as a safety net so the user
3426
3426
  // 📖 always sees a populated set on first start.
3427
+ // 📖 When no probeFn is available AND the user has keys, fall back to the
3428
+ // 📖 sync behaviour (keyed providers only) so we don't leak models the
3429
+ // 📖 user can't actually call.
3430
+ const fallbackPool = (probeFn == null && keyedProviders.size > 0)
3431
+ ? entries.filter((e) => e.hasKey)
3432
+ : entries
3427
3433
  const used = new Set()
3428
3434
  const ordered = []
3429
3435
  for (const { entry } of working) {
@@ -3433,6 +3439,7 @@ export async function buildDefaultRouterSet(config = {}, maxModels, options = {}
3433
3439
  ordered.push(entry)
3434
3440
  }
3435
3441
  for (const entry of failing) {
3442
+ if (!fallbackPool.includes(entry)) continue
3436
3443
  const key = `${entry.provider}/${entry.model}`
3437
3444
  if (used.has(key)) continue
3438
3445
  used.add(key)
@@ -49,6 +49,7 @@ import { getToolMeta, TOOL_METADATA } from './tool-metadata.js'
49
49
  import { PROVIDER_METADATA } from './provider-metadata.js'
50
50
  import { resolveToolBinaryPath } from './tool-bootstrap.js'
51
51
  import { ensureDir, readJson, writeJson } from './shared-helpers.js'
52
+ import { parseContextWindow } from './endpoint-installer.js'
52
53
 
53
54
  const OPENAI_COMPAT_ENV_KEYS = [
54
55
  'OPENAI_API_KEY',
@@ -338,7 +339,7 @@ function writeGooseConfig(model, apiKey, baseUrl, providerKey, paths = getDefaul
338
339
  description: `Managed by free-coding-models for ${providerLabel}`,
339
340
  api_key_env: secretEnvName,
340
341
  base_url: baseUrl?.endsWith('/chat/completions') ? baseUrl : (baseUrl || ''),
341
- models: [{ name: model.modelId, context_limit: 128000 }],
342
+ models: [{ name: model.modelId, context_limit: parseContextWindow(model.ctx) }],
342
343
  supports_streaming: true,
343
344
  requires_auth: true,
344
345
  }