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 the gaps left by generic SDKs (like OpenAI's) that lack essential local-model management features.

How it works

The SDK acts as a client that connects to LM Studio, allowing developers to programmatically control LLMs. It enables chat completions, text predictions, and the creation of autonomous agents by defining functions as tools. It also provides direct control over the model's lifecycle, such as loading, configuring, and unloading models from memory.

Who it’s for

TypeScript and JavaScript developers who want to integrate local LLMs into their applications using LM Studio across browser or Node-compatible environments.

Highlights

  • Local LLM interaction: Supports chat and text completions.
  • Model management: Ability to load, unload, and configure memory parameters like GPU offload and context length.
  • Agentic capabilities: Turn LLMs into autonomous agents using tool-calling functions.
  • Local-first: Designed specifically for local environments, including support for speculative decoding.
  • Environment flexibility: Works in both the browser and Node.js.

Related

  • Project
  • Project
  • Project
  • Project
  • Project