provider + model,
what does it accept? Which parameter carries the token limit? Is it a
reasoning model? Vision input? JSON schema mode? A temperature?
The answer is a ModelCapabilities value, computed at runtime from
rules and a defaults block. The first rule that
matches wins. Zero regex, zero allocation, zero runtime dependencies.
Canonical source:
crates/nika-catalog/data/model-capabilities.toml at v0.123.0.
Schema: nika/model-capabilities@1.0. The build checks every rule against
llm-providers.toml (an unknown provider fails the build, so a typo cannot
ship) and requires every any rule to come last within its provider scope.Resolution algorithm
1
Scan [[rules]] in file order
A rule whose
scope.providers list does not name the provider is
skipped, and so is one whose scope.api_dialect does not match the
provider’s dialect.2
The first match wins
The first rule whose
match clause matches the model name supplies its
caps, and the scan stops. Order is load-bearing: a narrow rule must come
before a broader one that would also match (o4 before o4-, gpt-4o
before gpt-4).3
Fill the rest from [defaults]
Every field the winning rule does not set comes from the defaults block:
The four match kinds
any: matches every model of the scope
any: matches every model of the scope
exact: matches one model id
exact: matches one model id
exact_any: matches a set of model ids
exact_any: matches a set of model ids
prefix_any: matches ids that start with a prefix
prefix_any: matches ids that start with a prefix
Capability fields
What a rule can set:Supported parameter vocabulary (13)
The vocabulary is closed: adding a new parameter is a
nika-catalog schema change.Modality vocabulary (8)
text · image · audio · video · pdf · embedding · speech · image-gen
Example resolution
Why not regex
L0 crates ship zero runtime dependencies beyond
std + alloc. Regex
would pull in regex-automata (~50k LOC) and force a runtime
initialization cost. prefix_any covers 95% of actual model-family
matching needs; the remaining 5% is handled by exact_any.How to query capabilities
Two shipped subcommands project the embedded catalogs —nika catalog
(providers · models · capabilities · env vars) and nika catalog --tools (the
nika:* builtin schemas), each with a versioned --json machine form:
Drift protection
Build-time FK check: every
scope.providers[i] must be a canonical
provider id in llm-providers.toml. Typos fail the build.Build-time enum check: every supported_parameters entry must be in
the 13-value vocabulary. New additions require a schema bump.Build-time ordering check: tags arrays in llm-providers.toml must
be sorted + deduplicated. Same applies to caps.* arrays by convention.See also
Providers catalog
The canonical providers these rules target.
Concepts · Providers
Model and access, the wires, structured output.
Schema
.nika envelope + workflow schema reference.L0 decisions
Q1-Q13: why no regex, why manual impl, why prefix-only matching.