lmstudio-ai/lmstudio-js
LM Studio TypeScript SDK
What it solves
It provides a dedicated TypeScript/JavaScript SDK for interacting with local LLMs via LM Studio, filling gaps left by generic SDKs (like OpenAI's) that lack local-specific controls such as memory management and hardware configuration.
How it works
The SDK acts as a client library that allows developers to communicate with LM Studio. It provides high-level methods to load and unload models from memory, configure GPU offload settings and context length, and execute chat completions, text predictions, and embedding generation.
Who it’s for
TypeScript and JavaScript developers building applications in Node-compatible environments or browsers who want to integrate local LLMs into their software.
Highlights
- Local model management: Load, configure, and unload models directly from memory.
- Agentic capabilities: Define functions as tools to create autonomous agents that run entirely locally.
- Local-first optimization: Supports speculative decoding and provides detailed model metadata like size and context length.
- Environment flexibility: Compatible with both the browser and Node.js environments.