Skip to content

Errors and type index

The error class, and a complete index of every exported type with the page that documents it.

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-cpp not 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.

Everything below exports from the package root. 36 types, 52 values.

Type Documented in
InferenceProvider Providers
CompleteJSONRequest Providers
CompleteJSONResponse Providers
TokenUsage Providers
Type Documented in
ProviderSpec Providers
ProviderName Providers
ProviderSelector Providers
ProviderIdentity Providers
AnthropicProviderOptions Providers
OpenAICompatProviderOptions Providers
LlamaCppProviderOptions Local models
MockResponse Providers
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
Type Documented in
ExecFn Exec
ExecOptions Exec
ExecResult Exec
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.

src/types.ts for InferenceError; src/index.ts for the export surface.