Errors and type index
The error class, and a complete index of every exported type with the page that documents it.
InferenceError
Section titled “InferenceError”class InferenceError extends Error { constructor(message: string);}name is "InferenceError". It is thrown for operational failures only:
- a missing API key,
- an unknown provider name,
- an unresolved
"auto"provider passed to a synchronous factory, - an unresolved local model selector passed to a synchronous factory,
node-llama-cppnot installed when a local provider is constructed,- detection finding no usable provider — the message names every provider and why each was unavailable.
A model failure is never thrown. It is recorded on run.error. Two classes, two handling paths —
see budgets and errors.
Catch it at your boundary and translate it into your own error type, or your CLI’s exit-code mapping will not recognise it.
Type index
Section titled “Type index”Everything below exports from the package root. 36 types, 52 values.
Provider contract
Section titled “Provider contract”| Type | Documented in |
|---|---|
InferenceProvider |
Providers |
CompleteJSONRequest |
Providers |
CompleteJSONResponse |
Providers |
TokenUsage |
Providers |
Provider configuration
Section titled “Provider configuration”| Type | Documented in |
|---|---|
ProviderSpec |
Providers |
ProviderName |
Providers |
ProviderSelector |
Providers |
ProviderIdentity |
Providers |
AnthropicProviderOptions |
Providers |
OpenAICompatProviderOptions |
Providers |
LlamaCppProviderOptions |
Local models |
MockResponse |
Providers |
Completion
Section titled “Completion”| Type | Documented in |
|---|---|
CompleteValidatedOptions |
Completion |
InferenceRun |
Completion |
| Type | Documented in |
|---|---|
EnsembleOptions |
Judge |
JudgeRun |
Judge |
JudgeVerdict |
Judge |
ConsensusResult |
Judge |
Match |
Judge |
Zone |
Judge |
ZoneThresholds |
Judge |
| Type | Documented in |
|---|---|
Pricing |
Cost |
Subprocess
Section titled “Subprocess”| Type | Documented in |
|---|---|
ExecFn |
Exec |
ExecOptions |
Exec |
ExecResult |
Exec |
Local models
Section titled “Local models”| Type | Documented in |
|---|---|
LlamaModelEntry |
Local models |
LlamaTier |
Local models |
LlamaSelector |
Local models |
LlamaRuntime |
Local models |
LlamaLoadedModel |
Local models |
LlamaSession |
Local models |
LlamaPromptOptions |
Local models |
LlamaPromptResult |
Local models |
ClearLlamaModelsOptions |
Local models |
ClearLlamaModelsResult |
Local models |
ClearedModelFile |
Local models |
JsonCache is a class, not a type — see Cache.
Source of truth
Section titled “Source of truth”src/types.ts for InferenceError; src/index.ts for the export surface.