ModelCatalog
Category: Core
Source: model_catalog.dart
Runtime types for the Glue model/provider catalog.
Status: part of the proposed core data model — see docs/plans/2026-04-29-harness-layers.md. Originally lived in catalog/model_catalog.dart; relocated so strategies and credentials can depend on these types without crossing the harness boundary.
The catalog parser and the bundled models_generated.dart snapshot stay in catalog/ because they pull in YAML/IO dependencies — only the pure data types move here.
Enums
AuthKind
How a provider obtains its credential.
- [apiKey] — a single string the user pastes in (or reads from an env var).
- [oauth] — an interactive OAuth flow (device code, PKCE). The adapter drives the flow via [ProviderAdapter.beginInteractiveAuth] and decides what fields to store.
- [none] — no credential needed (Ollama, local-vllm).
| Value | Description |
|---|---|
apiKey | |
oauth | |
none |
Classes
Capability
The canonical capability names used by the catalog.
Individual model entries list a subset in their capabilities field. The model picker filters on these via selection.default_filter.capabilities.
Properties
| Property | Type | Description |
|---|---|---|
chat | const | |
streaming | const | |
tools | const | |
parallelTools | const | |
vision | const | |
files | const | |
json | const | |
reasoning | const | |
coding | const | |
local | const | |
browser | const | |
binaryToolResults | const | |
all | const |
ModelCatalog
Top-level catalog object.
Constructor
const ModelCatalog({
required this.version,
required this.updatedAt,
required this.defaults,
required this.capabilities,
required this.providers,
})Properties
| Property | Type | Description |
|---|---|---|
version | int | |
updatedAt | String | |
defaults | DefaultsConfig | |
capabilities | Map<String, String> | Capability id → human description. |
providers | Map<String, ProviderDef> | Provider id → provider definition. |
DefaultsConfig
Constructor
const DefaultsConfig({required this.model, this.smallModel, this.localModel})Properties
| Property | Type | Description |
|---|---|---|
model | String | |
smallModel | String? | |
localModel | String? |
AuthSpec
Constructor
const AuthSpec({required this.kind, this.envVar, this.helpUrl})Properties
| Property | Type | Description |
|---|---|---|
kind | AuthKind | |
envVar | String? | Name of the environment variable that backs this provider's API key when [kind] is [AuthKind.apiKey]. When set, env wins over stored. |
helpUrl | String? | "Where do I get a key?" link shown in the /provider add form. |
id | String | |
name | String | |
adapter | String | Wire protocol: anthropic |
compatibility | String? | Quirks profile: openai |
enabled | bool | |
baseUrl | String? | |
docsUrl | String? | |
auth | AuthSpec | |
requestHeaders | Map<String, String> | |
models | Map<String, ModelDef> | Model id → model definition. |
id | String | Catalog key — stable, user-facing (CLI, config, session files, URLs). |
name | String | Human display label. |
apiId | String | The exact string sent to the provider's API. Defaults to [id] when the catalog entry doesn't override it. Let upstream slugs like openai/gpt-oss-120b live here instead of leaking into user-facing ids. |
recommended | bool | |
isDefault | bool | |
enabled | bool | When false, the model picker hides this entry but the catalog still records it. Useful for surfaces that aren't yet wired up at runtime (e.g. agents that need a background-execution runner). |
capabilities | Set<String> | |
contextWindow | int? | |
maxOutputTokens | int? | |
speed | String? | |
cost | String? | |
notes | String? |
Methods
`const ProviderDef({
required this.id,
required this.name,
required this.adapter,
required this.auth,
required this.models,
this.compatibility,
this.enabled = true,
this.baseUrl,
this.docsUrl,
this.requestHeaders = const {},
})`
`const ModelDef({
required this.id,
required this.name,
String? apiId,
this.recommended = false,
this.isDefault = false,
this.enabled = true,
this.capabilities = const {},
this.contextWindow,
this.maxOutputTokens,
this.speed,
this.cost,
this.notes,
})`
ProviderDef
Constructor
const ProviderDef({
required this.id,
required this.name,
required this.adapter,
required this.auth,
required this.models,
this.compatibility,
this.enabled = true,
this.baseUrl,
this.docsUrl,
this.requestHeaders = const {},
})Properties
| Property | Type | Description |
|---|---|---|
id | String | |
name | String | |
adapter | String | Wire protocol: anthropic |
compatibility | String? | Quirks profile: openai |
enabled | bool | |
baseUrl | String? | |
docsUrl | String? | |
auth | AuthSpec | |
requestHeaders | Map<String, String> | |
models | Map<String, ModelDef> | Model id → model definition. |
ModelDef
Constructor
const ModelDef({
required this.id,
required this.name,
String? apiId,
this.recommended = false,
this.isDefault = false,
this.enabled = true,
this.capabilities = const {},
this.contextWindow,
this.maxOutputTokens,
this.speed,
this.cost,
this.notes,
})Properties
| Property | Type | Description |
|---|---|---|
id | String | Catalog key — stable, user-facing (CLI, config, session files, URLs). |
name | String | Human display label. |
apiId | String | The exact string sent to the provider's API. Defaults to [id] when the catalog entry doesn't override it. Let upstream slugs like openai/gpt-oss-120b live here instead of leaking into user-facing ids. |
recommended | bool | |
isDefault | bool | |
enabled | bool | When false, the model picker hides this entry but the catalog still records it. Useful for surfaces that aren't yet wired up at runtime (e.g. agents that need a background-execution runner). |
capabilities | Set<String> | |
contextWindow | int? | |
maxOutputTokens | int? | |
speed | String? | |
cost | String? | |
notes | String? |