@namzu/http
v5.0.2
Published
Zero-dependency LLM provider for any OpenAI- or Anthropic-compatible HTTP endpoint. Use with vLLM, TGI, llama-server, Groq, DeepInfra, Together.ai, or any custom inference server.
Readme
The HTTP model driver for Namzu.
Install · Usage · Documentation
Implements the kernel's LLMProvider interface over a plain HTTP endpoint.
Speaks two wire dialects and refuses a mismatch rather than guessing which
one a gateway meant. 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/http@namzu/sdk is a peer dependency. Install both.
Usage
import { ProviderRegistry } from '@namzu/sdk'
import { registerHttp } from '@namzu/http'
registerHttp() // once, at startup
const { provider } = ProviderRegistry.create({
type: 'http',
baseURL: 'http://localhost:8000/v1',
apiKey: process.env.INFERENCE_TOKEN ?? '',
dialect: 'openai',
})
for await (const chunk of provider.chatStream({
model: 'my-served-model',
messages: [{ role: 'user', content: 'Hello' }],
})) {
if (chunk.delta.content) process.stdout.write(chunk.delta.content)
}chatStream is the only model entry point; a non-streaming call is that
stream collected. In practice the kernel's turn loop calls it and hands you
events.
Documentation
License
FSL-1.1-MIT, converting to MIT two years after each release.
