Skip to main content

LLMlight is a Python library for ...

Project description

LLMlight

Python Pypi Docs LOC Downloads Downloads License Forks Issues Project Status Medium Donate

LLMlight is a Python package for running Large Language Models (LLMs) locally with minimal dependencies. It provides a simple interface to interact with various LLM models, including support for GGUF models and local API endpoints. ⭐️Star it if you like it⭐️

Schematic Overview

Key Features

Feature Description
Local LLM Support Run LLMs locally with minimal dependencies.
Full Prompt Control Fine-grained control over prompts including Query, Instructions, System, Context, Response Format, Automatic formatting, Temperature, and Top P.
Single Endpoint for All Local Models One unified endpoint to connect different local models.
Flexible Embedding Methods Multiple embedding strategies: TF-IDF for structured documents, Bag of Words (BOW), BERT for free text, BGE-Small.
Advanced Retrieval Methods Supports Naive RAG with fixed chunking and RSE (Relevant Segment Extraction).
Context Strategies Advanced reasoning for complex queries using Global-reasoning and Chunk-wise approaches.
Local Memory Video memory storage for efficient local use.
PDF Processing Native support for reading and processing PDF documents.

Documentation & Resources

Installation

# Install from PyPI
pip install LLMlight

Quick Start

1. Check Available Models at Endpoint

from LLMlight import LLMlight

# Initialize client
from LLMlight import LLMlight
# Initialize with LM Studio endpoint
client = LLMlight(model='mistralai/mistral-small-3.2',
                  endpoint="http://localhost:1234/v1/chat/completions")

modelnames = client.get_available_models(validate=False)
print(modelnames)

2. Basic Usage with Endpoint

from LLMlight import LLMlight

# Initialize with default settings
client = LLMlight(model='openai/gpt-oss-20b', endpoint='http://localhost:1234/v1/chat/completions')

# Run a simple query
response = client.prompt('What is the capital of France?',
                         context='The capital of France is Amsterdam.',
                         instructions='Do not argue with the information in the context. Only return the information from the context.')
print(response)
# According to the provided context, the capital of France is Amsterdam.

3. Using with LM Studio

https://erdogant.github.io/LLMlight/pages/html/Algorithm.html#get-available-llm-models

3. Query against PDF files

https://erdogant.github.io/LLMlight/pages/html/Examples.html#working-with-files-pdfs

4. Creating Local Memory Database

https://erdogant.github.io/LLMlight/pages/html/Saving%20and%20Loading.html#memory-management

Maintainer

  • Erdogan Taskesen, github: erdogant
  • Contributions are welcome.
  • Yes! This library is entirely free but it runs on coffee! :) Feel free to support with a Coffee.

Buy me a coffee

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llmlight-1.2.0.tar.gz (68.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llmlight-1.2.0-py3-none-any.whl (72.9 kB view details)

Uploaded Python 3

File details

Details for the file llmlight-1.2.0.tar.gz.

File metadata

  • Download URL: llmlight-1.2.0.tar.gz
  • Upload date:
  • Size: 68.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for llmlight-1.2.0.tar.gz
Algorithm Hash digest
SHA256 b3e642dd65ce3f7299922977e11b820cfe5ad41cda501c8ed9878ba02ced9be7
MD5 bef2c934ccb982ec58dfbdace0589ee7
BLAKE2b-256 9dea17e707a6ba0de45cf79100aca156de20a19bfd4b2c4b3c66ebb83b4c95b1

See more details on using hashes here.

File details

Details for the file llmlight-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: llmlight-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 72.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for llmlight-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8fb036be6a54d53a1117d7fbe6c406f37beeed5f839a44e8eee7ecefc00bcbcb
MD5 a9ecd88daa9ab90f305ae3d3fba634ac
BLAKE2b-256 0d57e950a7a0d3e7cd801292457b9ee3aac5efc34274e301707f697a36af5e3b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page