lmstudio-python  by lmstudio-ai

Python SDK for LM Studio local LLM management

created 5 months ago
584 stars

Top 56.3% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
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 day ago

Responsiveness

1 day

Pull Requests (30d)
12
Issues (30d)
6
Star History
209 stars in the last 90 days

Explore Similar Projects

Starred by Peter Norvig Peter Norvig(Author of Artificial Intelligence: A Modern Approach; Research Director at Google), Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), and
2 more.

aisuite by andrewyng

0.2%
12k
Unified interface for multiple generative AI providers
created 1 year ago
updated 3 days ago
Feedback? Help us improve.