Integration · @namzu/lmstudio
Namzu × LM Studio.Local models through a desktop model server.
A local LM Studio server through the official LM Studio SDK: no key, no egress.
Install.
pnpm add @namzu/sdk @namzu/lmstudio@namzu/sdk is a peer dependency, so install both. The SDK needs zod@^3 too.
Why pair the kernel with LM Studio.
LM Studio gives a polished way to download, load and serve local models. Namzu gives the runtime layer to build on top of it, with no key and no egress.
- The driver uses the official
@lmstudio/sdk, which connects over a websocket to the LM Studio server (defaulthttp://localhost:1234, orLMSTUDIO_HOST). The socket opens on first use, not when the provider is constructed. - The model must be loaded in LM Studio.
timeoutcovers resolving the model as well as generating, because the wait it exists for is a websocket that connects while the model is still loading. - It streams text. It does not send tool schemas, and image attachments are dropped.
- The server also speaks the OpenAI wire.
@namzu/httpwithdialect: 'openai'andbaseURL: 'http://localhost:1234/v1'reaches it as a plain HTTP endpoint instead.
Status.The LM Studio driver is not yet selectable in the terminal app. Use it from the SDK.
Example.
import { ProviderRegistry, runAgent } from '@namzu/sdk'
import { registerLMStudio } from '@namzu/lmstudio'
registerLMStudio() // once, at startup
const model = 'qwen2.5-coder-14b' // a model loaded in LM Studio
const { provider } = ProviderRegistry.create({
type: 'lmstudio',
host: 'http://localhost:1234',
model,
})
const { output } = await runAgent({ provider, model, prompt: 'Hello' })
console.log(output)Configure.
Configuration (type: 'lmstudio')
- hoststring
- LM Studio server. Defaults to
http://localhost:1234or theLMSTUDIO_HOSTenvironment variable. - modelstring
- Model identifier; it must be loaded in LM Studio.
- timeoutnumber (ms)
- Deadline for a completion, including resolving the model. Absent means none.
What the driver declares.
- StreamingYes
- Tool callsNot sent
- Image attachmentsDropped
- Document attachmentsNot mapped
Ship LM Studio agents on a runtime you can own.
LM Studio owns the model server. Namzu owns the runtime. The package is a thin adapter, not a wrapper, so you keep everything LM Studio ships and add the kernel concerns you do not get from the model API alone.