lmstudio-python
View on GitHubLM Studio Python SDK
Official Python SDK for LM Studio: connect to a local LM Studio server to run chat, completion, tool-use, and schema-constrained inference with locally hosted LLMs, with sync and async clients plus model load/unload management.
Use Cases
Run chat and text completion against locally hosted LLMsFunction/tool calling with local modelsStructured JSON output via schemasSpeculative decoding experimentsLoad/unload and manage local model instancesBuild Python apps on top of a local LM Studio serverSync and async inference sessions over WebSocketChatbot and terminal-simulation examples
Built With
- Language
- Python
- Frameworks
- httpx · httpx-ws · anyio · msgspec · typing-extensions · pytest · tox · ruff · mypy · PDM
Tags
python-sdk · llm · local-llm · lm-studio · inference · chat · tool-use · structured-output · async · websocket · json-schema · speculative-decoding · model-management · developer-tooling