skillfed

lmstudio

LM Studio Python SDK

lmstudio v1.5.0 91.7K downloads/30d#13,504 on PyPI
License unclear AGING released

What it is and what it does

The LM Studio Python SDK is a client library for programmatically interacting with LM Studio, a local large language model application. It provides both a synchronous Client and a convenience API for text completion and chat workflows, communicating with a running LM Studio instance over WebSocket. The package depends on httpx, httpx-ws, msgspec, typing-extensions, and anyio to handle HTTP/WebSocket communication and async utilities.

The SDK is designed for developers who want to integrate local LLM inference into Python applications without cloud dependencies. It offers a simple interface for loading models, requesting completions, and managing chat history, with support for Python 3.10 through 3.13. The package has been in production use since 2023 but has not received updates for over a year, suggesting it is stable but not actively maintained.

Use it for:

  • Build a local chatbot application that maintains conversation history and responds without external API calls.
  • Integrate text completion from a locally-running LLM into a Python data processing or analysis pipeline.
  • Prototype and test LLM-based features during development before deploying to a cloud service.
  • Create a command-line tool that queries a local model for code generation, summarization, or question-answering.
  • Batch-process documents or logs using a local model for classification, extraction, or transformation tasks.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Python SDK for interacting with LM Studio, a local LLM application, enabling text completion and chat interactions with loaded language models via WebSocket.

Yes, if you already run LM Studio locally and want a straightforward Python interface to it. The package has low install friction, no known vulnerabilities, and stable production status. However, the 357-day gap since the last release and unclear license terms warrant caution: verify license compliance before commercial use, and expect slower community support if issues arise. Not suitable if you need active maintenance or cloud-based LLM access.

Install

lmstudio on PyPI

pip

pip install lmstudio

uv

uv add lmstudio

poetry

poetry add lmstudio

Installing lmstudio

Before you install

Low install friction with a pure-Python wheel distribution. Maintenance status is aging—last release was 357 days ago—so expect slower response to issues, though the package is marked Production/Stable and supports current Python versions.

License in practice

License treatment is unclear; no SPDX identifier or raw license text is available in the package metadata. Verify the actual license terms before adopting in a commercial or restricted-license context.

Quickstart

pip install lmstudio

import lmstudio as lms

model = lms.llm()
response = model.complete("Once upon a time,")

Requires LM Studio application running locally and listening on the default WebSocket endpoint; Python 3.10 or later.

Verify before relying

  • Whether LM Studio application must be pre-installed and running before the SDK can be used.
  • Default WebSocket endpoint and port that the SDK connects to.
  • Whether async API is available in addition to the synchronous Client.
  • Supported LM Studio versions and any version compatibility constraints.

Package facts

License not declared (unclear)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 5 — httpx, httpx-ws, msgspec, typing-extensions, anyio
Maintenance aging — 357 days since the last release
First released
Downloads 91,728/month — #13,504 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: lmstudio-1.5.0-py3-none-any.whl

Development Status :: 5 - Production/StableProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Scientific/Engineering :: Artificial IntelligenceTyping :: Typed

Tags

local llm python clientlm studio sdkllm text completion apichat with local modelswebsocket language model clientoffline llm integrationlocal ai model interface
local-llmwebsocket-clientoffline-inference

More Artificial Intelligence packages