Skip to main content

Minimalist Library for programming with LLMs

Project description

MiniLLMLib

PyPI version Docs License: MIT Python

A Python library for interacting with various LLM providers (OpenAI, Anthropic, Mistral, HuggingFace, through URL).

Author: Quentin Feuillade--Montixi

Installation

From Source

git clone https://github.com/qfeuilla/MiniLLMLib.git
cd MiniLLMLib
pip install -e .  # Install in editable mode

Usage

import minillmlib as mll

# Create a GeneratorInfo for your model/provider
import os

gi = mll.GeneratorInfo(
    model="gpt-4",
    _format="openai",
    api_key=os.getenv("OPENAI_API_KEY")  # Recommended: use env var for secrets
)

# Create a chat node (conversation root)
chat = mll.ChatNode(content="Hello!", role="user")

# Synchronous completion
response = chat.complete_one(gi)
print(response.content)

# Or asynchronous version
# response = await chat.complete_one_async(gi)

Features

  • Unified interface for major LLM providers:
    • OpenAI, Anthropic, Mistral, HuggingFace (local), custom URL (e.g. OpenRouter)
  • Thread (linear) and loom (tree/branching) conversation modes
  • Synchronous & asynchronous API
  • Audio completions (OpenAI audio models, beta)
  • Flexible parameter/config management via GeneratorInfo and GeneratorCompletionParameters
  • Save/load conversation trees
  • Extensible: add new models/providers easily

Documentation

  • See the Usage Guide for advanced usage, parameter tables, and branching/loom semantics.
  • See the Provider Matrix for supported models and configuration tips.
  • See Troubleshooting for common issues and debugging.

Configuration

Development & Contribution

  • Run tests with:
    pytest tests/
    
  • See Contributing for contribution guidelines.

For more, see the full documentation at minillmlib.readthedocs.io or open an issue on GitHub if you need help.

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

minillmlib-0.1.0.tar.gz (42.2 kB view details)

Uploaded Source

Built Distribution

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

minillmlib-0.1.0-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for minillmlib-0.1.0.tar.gz
Algorithm Hash digest
SHA256 56a65de52e8b179b0559d3985cf19b24494f2bcf3ef5324ce654e2e5ec143478
MD5 3dea7853f54d0971c1b08b91967f96a4
BLAKE2b-256 8f3f650b0fdb4d4d38b11b0a84034407a8331ee517a340301d509f424c3e379d

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for minillmlib-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f405b87fea1bcc2fd20fa2841a9e711a8c277380c52831fcd618df20b35a9a9e
MD5 b02ba85810b955057b7cc924ce6b3255
BLAKE2b-256 0ecd5f7edd08b8c4ae4012e0a7368e8ca4eb9f8f61069c9b30585f1ff41886cb

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