lmstudio-python  by lmstudio-ai

Python SDK for LM Studio local LLM management

Created 7 months ago
629 stars

Top 52.7% on SourcePulse

GitHubView on GitHub
Project Summary

This Python SDK provides a convenient interface for interacting with the LM Studio application, enabling developers to easily integrate local large language models (LLMs) into their Python applications. It simplifies tasks such as text completion and chat interactions, abstracting away the complexities of underlying WebSocket connections.

How It Works

The SDK offers a synchronous Client for direct control over connections and a higher-level convenience API for interactive use. This convenience API implicitly manages a default client instance. For chat functionalities, a Chat helper class manages conversation history, allowing seamless integration with the LLM's response prediction.

Quick Start & Requirements

Highlighted Details

  • Simplified text completion and chat interaction with LLMs.
  • Chat helper class for managing conversation history.
  • SDK versioning follows a modified semantic versioning scheme (X.Y.Z).
  • Development environment setup relies on pdm, tox, and tox-pdm.

Maintenance & Community

  • Development is managed via tox for formatting, linting, and testing.
  • Code consistency is enforced using ruff and mypy.
  • Tests are written with pytest and can be run across multiple Python versions via tox.
  • API schema generation is automated using sync-sdk-schema.py.

Licensing & Compatibility

  • License: Not explicitly stated in the provided README.

Limitations & Caveats

  • The README does not specify the license, which is crucial for commercial use considerations.
  • The SDK's functionality is dependent on a running LM Studio instance.
Health Check
Last Commit

1 week ago

Responsiveness

1 day

Pull Requests (30d)
3
Issues (30d)
4
Star History
28 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.