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 Colab 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.

🌟 Key Features

  • Local LLM Support: Run LLMs locally with minimal dependencies
  • Multiple Model Support: Compatible with various models including:
    • Hermes-3-Llama-3.2-3B
    • Mistral-7B-Grok
    • OpenHermes-2.5-Mistral-7B
    • Gemma-2-9B-IT
  • Flexible Embedding Methods: Support for multiple embedding approaches:
    • TF-IDF for structured documents
    • Bag of Words (BOW)
    • BERT for free text
    • BGE-Small
  • Advanced Retrieval Methods:
    • Naive RAG with fixed chunking
    • RSE (Relevant Segment Extraction)
  • PDF Processing: Built-in support for reading and processing PDF documents
  • Global Reasoning: Advanced reasoning capabilities for complex queries

📚 Documentation & Resources

🚀 Quick Start

Installation

# Install from PyPI
pip install LLMlight

# Install from GitHub
pip install git+https://github.com/erdogant/LLMlight

Basic Usage

from LLMlight import LLMlight

# Initialize with default settings
model = LLMlight()

# Run a simple query
response = model.run('What is the capital of France?', 
                    system="You are a helpful assistant.")

# Use with a local GGUF model
model = LLMlight(endpoint='path/to/your/model.gguf')
response = model.run('Tell me about quantum computing')

📊 Examples

1. Using with LM Studio

from LLMlight import LLMlight

# Initialize with LM Studio endpoint
model = LLMlight(endpoint="http://localhost:1234/v1/chat/completions")

# Run queries
response = model.run('Explain quantum computing in simple terms')

2. Processing PDF Documents

from LLMlight import LLMlight

# Initialize model
model = LLMlight()

# Read and process PDF
model.read_pdf('path/to/document.pdf')

# Query about the document
response = model.run('Summarize the main points of this document')

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

👥 Contributors

👨‍💻 Maintainer

☕ Support

This library is free and open source. If you find it useful, consider supporting its development:

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

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-0.1.0.tar.gz (22.3 kB view details)

Uploaded Source

Built Distribution

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

llmlight-0.1.0-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llmlight-0.1.0.tar.gz
  • Upload date:
  • Size: 22.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for llmlight-0.1.0.tar.gz
Algorithm Hash digest
SHA256 126842da352d360b4790396ce21342d7008510de71c422adc2bb7d2855e90553
MD5 0ae096e183a9274b21768e5554f5ce95
BLAKE2b-256 42ea281fee789202aaf9689b3f55f8a55a7dbfcff7ed5d2e1a89effab87d4d4c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: llmlight-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for llmlight-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6ba894fb01106c6f06850ace8efa9cf96786f366f32f580ad69e5b442d021de9
MD5 f122850011dabbbbdd76ec0ed5b8d86f
BLAKE2b-256 335574f23d116347cfac334e19d6b69d5e7bc751c7e5da71bd2163c64c0aacbf

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