Skip to content

Provider

The Provider primitive abstracts LLM inference endpoints. A Claw can reference multiple providers with fallback chains, cost routing, and capability-based selection. At least one Provider is required in every manifest.

URI pattern: claw://local/provider/{name}


claw: "0.3.0"
kind: Provider
metadata:
name: "primary-llm"
version: "1.0.0"
spec:
protocol: "openai-compatible" # "openai-compatible" | "anthropic-native" | "custom"
endpoint: "https://api.example.com/v1"
model: "gpt-5-turbo"
auth:
type: "bearer" # "bearer" | "api-key-header" | "oauth2" | "none"
secret_ref: "LLM_API_KEY"
streaming: true
hints:
cost_priority: 0.3 # 0.0 (ignore cost) to 1.0 (minimize cost)
speed_priority: 0.5 # 0.0 (ignore speed) to 1.0 (minimize latency)
intelligence_priority: 0.8 # 0.0 (any quality) to 1.0 (maximize quality)
fallback:
- provider_ref: "secondary-llm"
- provider_ref: "local-llm"
limits:
tokens_per_day: 500000
tokens_per_request: 32000
requests_per_minute: 60
max_context_window: 200000
retry:
max_attempts: 3
backoff: "exponential" # "exponential" | "linear" | "constant"
initial_delay_ms: 1000

FieldRequiredDescription
protocolYesProtocol for communicating with the LLM endpoint.
endpointYesBase URL for the inference API.
modelYesModel identifier string.
authYesAuthentication configuration.
auth.typeYesOne of bearer, api-key-header, oauth2, none.
auth.secret_refConditionalEnvironment variable or secret store key. Required when auth.type is not none.
streamingNoEnable streaming responses.
hintsNoModel selection hints following MCP’s modelPreferences pattern.
fallbackNoOrdered fallback chain of alternative providers.
limitsNoUsage limits for cost governance.
retryNoRetry configuration for transient failures.

  • A Claw manifest MUST include at least one Provider primitive.
  • The protocol, endpoint, model, and auth fields are REQUIRED.
  • When auth.type is not none, auth.secret_ref MUST be present.
  • Fallback providers, if declared, MUST be tried in array order. The runtime MUST NOT skip entries.
  • If limits.tokens_per_day is present, the runtime MUST enforce it and reject requests that would exceed the limit with error code -32021.

The Provider primitive normalizes multi-LLM abstraction, cascading fallback, cost-aware routing, and token governance into a single declaration. The hints field follows MCP’s modelPreferences pattern, enabling runtimes to make intelligent routing decisions across multiple providers without framework-specific configuration.