can1357/oh-my-pi · error · Error
No models available. Use --model to select a model or config
Error message
No models available. Use --model to select a model or configure enabledModels/default model settings.
What it means
When no --model selector is given, dry-balance falls back to the allowed-models list (enabledModels/default model settings). If that list is empty there is nothing to benchmark, so the command aborts with this guidance message instead of guessing a model.
Source
Thrown at packages/coding-agent/src/cli/dry-balance-cli.ts:568
settings: Settings | undefined,
randomSessionId: () => string,
): Promise<{ model: Model<Api>; warning?: string }> {
const preferences = getModelMatchPreferences(settings);
if (modelSelector) {
const resolved = resolveCliModel({
cliModel: modelSelector,
modelRegistry,
settings,
preferences,
});
if (resolved.error) throw new Error(resolved.error);
if (!resolved.model) throw new Error(`Model "${modelSelector}" not found`);
return { model: resolved.model, warning: resolved.warning };
}
const allowedModels = await resolveAllowedModels(modelRegistry, settings, preferences);
if (allowedModels.length === 0) {
throw new Error(
"No models available. Use --model to select a model or configure enabledModels/default model settings.",
);
}
const defaultRoleSpec = resolveModelRoleValue(settings?.getModelRole("default"), allowedModels, {
settings,
matchPreferences: preferences,
});
if (defaultRoleSpec.model) {
return { model: defaultRoleSpec.model, warning: defaultRoleSpec.warning };
}
for (const candidate of allowedModels) {
const apiKey = await modelRegistry.getApiKey(candidate, randomSessionId());
if (apiKey) return { model: candidate };
}
return {View on GitHub (pinned to 9690622007)
Solutions
- Pass an explicit model: omp dry-balance --model <provider/model-id>
- Configure enabledModels in settings with at least one available model id
- Set a default model (default model role) in settings or preferences
- Verify providers are authenticated so their models appear in the registry
Example fix
// before omp dry-balance # no models configured // after omp dry-balance --model groq/llama-3.3-70b-versatile
Defensive patterns
Strategy: try-catch
Validate before calling
const allowed = await resolveAllowedModels(registry, settings, preferences);
if (allowed.length === 0) {
console.error('No models available: configure enabledModels/default model or pass --model.');
} Try / catch
try {
await runDryBalance(argv);
} catch (e) {
if (/No models available/.test((e as Error).message)) {
console.error('Configure a default model / enabledModels in settings, or pass --model <provider/model>.');
} else throw e;
} Prevention
- On fresh installs, set a default model before running dry-balance
- Keep enabledModels non-empty and pointing at ids that still exist
- Prefer passing --model explicitly in scripts to avoid depending on ambient settings
When it happens
Trigger: Running `omp dry-balance` (no --model) when resolveAllowedModels returns zero entries — no models configured in settings, enabledModels empty or excluding everything, and no default model role resolvable.
Common situations: Fresh installs with no configured providers, users who set enabledModels to an empty list or ids that no longer exist, or environments where the model registry failed to load any providers.
Related errors
- resolved.error (model resolution failure)
- Model "${options.model}" not found
- Model "${modelSelector}" not found
- Model "${options.model}" not found
- Model "${parsed.planYoloInto ?? "@smol"}" not found
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/d633266a63aaac45.
Report an issue: GitHub.