Documentation
Getting Started
Predicting with LLMs
Agentic Flows
Text Embedding
Tokenization
Manage Models
Model Info
Getting Started
Predicting with LLMs
Agentic Flows
Text Embedding
Tokenization
Manage Models
Model Info
Project Setup
lmstudio
is a library published on PyPI that allows you to use lmstudio-python
in your own projects.
It is open source and developed on GitHub.
You can find the source code here.
lmstudio-python
As it is published to PyPI, lmstudio-python
may be installed using pip
or your preferred project dependency manager (pdm
and uv
are shown, but other
Python project management tools offer similar dependency addition commands).
pip install lmstudio
All of the examples in the documentation assume that the server API is running locally
on the default port. The network location of the server API can be overridden by
passing a "host:port"
string when creating the client instance.
import lmstudio as lms
SERVER_API_HOST = "localhost:1234"
# This must be the *first* convenience API interaction (otherwise the SDK
# implicitly creates a client that accesses the default server API host)
lms.configure_default_client(SERVER_API_HOST)
# Note: the dedicated configuration API was added in lmstudio-python 1.3.0
# For compatibility with earlier SDK versions, it is still possible to use
# lms.get_default_client(SERVER_API_HOST) to configure the default client
On this page
Installing lmstudio-python
Customizing the server API host and TCP port