@namzu/anthropic
v4.0.1
Published
Anthropic LLM provider for @namzu/sdk via the official @anthropic-ai/sdk. Messages API with streaming, tool-use, and extended thinking support.
Readme
The Anthropic model driver for Namzu.
Install · Usage · Documentation
Implements the kernel's LLMProvider interface over the official
@anthropic-ai/sdk, so nothing above the driver layer knows which vendor is
answering. Installed only if you use it — the kernel has no preferred vendor
and no driver is a dependency of it.
Install
pnpm add @namzu/sdk @namzu/anthropic@namzu/sdk is a peer dependency. Install both.
Usage
import { ProviderRegistry, collectChatCompletion } from '@namzu/sdk'
import { registerAnthropic } from '@namzu/anthropic'
// Once, at startup. Module augmentation extends the config union, so the
// call below is fully type-narrowed on `type: 'anthropic'`.
registerAnthropic()
const { provider } = ProviderRegistry.create({
type: 'anthropic',
apiKey: process.env.ANTHROPIC_API_KEY,
model: 'claude-sonnet-4-5-20250929',
})
const response = await collectChatCompletion(
provider.chatStream({
model: 'claude-sonnet-4-5-20250929',
messages: [{ role: 'user', content: 'Hello' }],
}),
)chatStream is the only model entry point; a non-streaming call is that stream
collected. In practice the kernel's run loop calls it and hands you events.
Signed thinking and encrypted redacted blocks are persisted with versioned
adapter state plus their exact provider/model/fallback route. The same
configured route replays them after restart or /resume; another model,
provider, or chain member receives portable assistant/tool history without
foreign native thinking metadata.
Set exactly one of apiKey or authToken. The kernel's credential vault can
hold the key instead, so it never reaches the driver's config as a plain
string.
Documentation
- The Anthropic driver — every configuration field, extended thinking, strict tool inputs
- Namzu docs
License
FSL-1.1-MIT, converting to MIT two years after each release.
