Skip to main content

lmstudiox

An extended Python SDK for LM Studio with support for explicitly enabling or disabling model thinking mode.

lmstudiox extends the official lmstudio Python SDK with additional capabilities, including explicit control over model thinking mode.

It provides an API compatible with the original SDK while allowing developers to disable thinking mode when needed.

Features

  • Thinking Mode Control: Explicitly enable or disable model thinking mode through LlmPredictionConfig.
  • Familiar API: Built on top of the official lmstudio SDK, retaining its familiar usage patterns.
  • Streaming Support: Supports asynchronous streaming responses.
  • Version Alignment: The package version is kept in sync with the official lmstudio package version on PyPI.

Installation

pip install lmstudiox

Usage

The following example demonstrates the difference between the official lmstudio SDK and lmstudiox when interacting with a model.

import asyncio
import lmstudio
import lmstudiox


# Use the official lmstudio SDK (thinking mode enabled by default).
async def use_lmstudio():
    async with lmstudio.AsyncClient("localhost:1234") as client:
        model = await client.llm.model("qwen3.5-9b")
        stream = await model.respond_stream("hello !")
        async for x in stream:
            if x.content:
                print(x.content, end="", flush=True)
        print()


# Use lmstudiox to explicitly disable thinking mode.
async def use_lmstudiox():
    async with lmstudiox.AsyncClient("localhost:1234") as client:
        model = await client.llm.model("qwen3.5-9b")
        stream = await model.respond_stream("hello !", config=lmstudiox.LlmPredictionConfig(enable_thinking=False))
        async for x in stream:
            if x.content:
                print(x.content, end="", flush=True)
        print()


# Run both examples for comparison.
asyncio.run(use_lmstudio())
asyncio.run(use_lmstudiox())

Requirements

  • Python >= 3.12
  • LM Studio with its local API server enabled

Acknowledgements

This project is built on top of the official LM Studio Python SDK.

Special thanks to the LM Studio team for providing the underlying SDK and local inference platform.

License

See LICENSE for details.

Metadata

Release files for lmstudiox 1.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lmstudiox 1.5.0
File Size Uploaded Provenance Actions
lmstudiox-1.5.0.tar.gz 331.8 kB Without provenance Details for lmstudiox-1.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lmstudiox 1.5.0
File Interpreter ABI Platform Actions
lmstudiox-1.5.0-py3-none-any.whl Python 3 none any Details for lmstudiox-1.5.0-py3-none-any.whl

Total release size: 677.4 kB

Release files / lmstudiox-1.5.0.tar.gz

Download URL lmstudiox-1.5.0.tar.gz
Size 331.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e73c4c45c028c3aebb8f39cc0e25906cec402094fdd27e326022bbdfd99b32e6
BLAKE2b-256 checksum
How to use checksums
2c4603b4a0b2dd5758454bdbc2e6eff028a38b4c74dadbaba9f493085d06be0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.34.2

Release files / lmstudiox-1.5.0-py3-none-any.whl

Download URL lmstudiox-1.5.0-py3-none-any.whl
Size 345.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7b89b67d94e0ae5f20c9d8ab196e5691f77a7474fd8612796d1347feed331ae3
BLAKE2b-256 checksum
How to use checksums
0af31f9a72fb4619e98dc7e66bceae7a9feee083e791a5fa014b17a4c6a55497
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.34.2

Security for lmstudiox 1.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page