Skip to content

Interface: AnthropicLLMParams

@providerprotocol/ai


@providerprotocol/ai / anthropic / AnthropicLLMParams

Defined in: src/providers/anthropic/types.ts:134

Provider-specific parameters for Anthropic Claude models.

These parameters are passed through to the Anthropic Messages API and control model behavior such as sampling, token limits, and extended thinking.

const params: AnthropicLLMParams = {
max_tokens: 4096,
temperature: 0.7,
thinking: { type: 'enabled', budget_tokens: 10000 },
};

optional container: string

Defined in: src/providers/anthropic/types.ts:203

Container ID for code execution tool reuse. Pass the container ID from a previous response to reuse the same environment.


optional max_tokens: number

Defined in: src/providers/anthropic/types.ts:136

Maximum number of tokens to generate. Defaults to model maximum if not specified.


optional metadata: object

Defined in: src/providers/anthropic/types.ts:151

Request metadata for tracking and analytics.

optional user_id: string

Unique identifier for the end user making the request.


optional service_tier: "auto" | "standard_only"

Defined in: src/providers/anthropic/types.ts:169

Service tier selection for capacity routing.

  • auto: Automatically select based on availability (default)
  • standard_only: Only use standard capacity, never priority

optional stop_sequences: string[]

Defined in: src/providers/anthropic/types.ts:148

Custom sequences that will cause the model to stop generating.


optional temperature: number

Defined in: src/providers/anthropic/types.ts:139

Sampling temperature from 0.0 (deterministic) to 1.0 (maximum randomness).


optional thinking: object

Defined in: src/providers/anthropic/types.ts:157

Extended thinking configuration for complex reasoning tasks.

budget_tokens: number

Token budget for the thinking process.

type: "enabled"

Must be ‘enabled’ to activate extended thinking.


optional tool_choice: object

Defined in: src/providers/anthropic/types.ts:212

Tool selection strategy.

  • auto: Model decides when to use tools
  • any: Model must use at least one tool
  • tool: Model must use the specific tool named in name

optional name: string

type: "auto" | "tool" | "any"


optional tools: AnthropicBuiltInTool[]

Defined in: src/providers/anthropic/types.ts:197

Built-in tools for server-side execution.

Use the tool helper constructors from the tools namespace:

  • tools.webSearch() - Web search capability
  • tools.computer() - Computer use (mouse, keyboard, screenshots)
  • tools.textEditor() - File viewing and editing
  • tools.bash() - Shell command execution
  • tools.codeExecution() - Sandboxed Python/Bash execution
  • tools.toolSearch() - Dynamic tool catalog search
import { anthropic, tools } from 'provider-protocol/anthropic';
const model = llm({
model: anthropic('claude-sonnet-4-20250514'),
params: {
tools: [
tools.webSearch({ max_uses: 5 }),
tools.codeExecution(),
],
},
});

optional top_k: number

Defined in: src/providers/anthropic/types.ts:145

Top-k sampling. Only the k most likely tokens are considered at each step.


optional top_p: number

Defined in: src/providers/anthropic/types.ts:142

Nucleus sampling threshold. Only tokens with cumulative probability <= top_p are considered.