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* SDK interaction (otherwise the SDK will
# implicitly attempt to access the default server instance)
lms.get_default_client(SERVER_API_HOST)
On this page
Installing lmstudio-python
Customizing the server API host and TCP port