Skip to main content

Minimal toolkit for LLM

Project description

MinimalLLM

pip install MinimalLLM

Minimal and handy interfaces of LLMs based on LiteLLM.

Features:

  • Minimal and intuitive interfaces. You don't need to learn
  • Handy cache system for faster testing
  • Support for multiple LLMs by LiteLLM

Usage

Chat

from mllm import Chat
chat = Chat()
chat += "Give me a random number from 1 to 10"
res = chat.complete(cache=True)
print(res)
chat = Chat()
chat += "Give a json dict with keys 'a' and 'b' and values 1 and 2"
res = chat.complete(parse="dict", cache=True)
print(res)

Embedding

from mllm import get_embeddings
embeddings = get_embeddings(["Hello, world!", "Goodbye, world!"])
print(embeddings)
# Embeddings are automatically cached

Visualized Log of chats

from mllm import Chat, display_chats
with display_chats():
    chat = Chat()
    chat += "Who is your developer?"
    res = chat.complete(cache=True)
    # A web page will be opened to show the chat log

Providers

MinimalLLM is based on LiteLLM, which supports multiple providers. You can switch the provider to use different LLMs.

Switch provider

from mllm.provider_switch import set_default_to_anthropic
set_default_to_anthropic()

To setup the API keys for the providers, we recommend to use the following wizard:

from mllm.setup.wizard import setup_wizard
setup_wizard()

You can run in the command line:

python -m mllm.setup.wizard

Installation

pip install -U git+https://github.com/EvoEvolver/MinimalLLM

To add it to your requirements.txt:

MinimalLLM @ git+https://github.com/EvoEvolver/MinimalLLM

Why minimal?

Minimal means stable. We only provide the most basic interfaces and features.

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

minimalllm-1.0.4.tar.gz (100.0 kB view details)

Uploaded Source

Built Distribution

MinimalLLM-1.0.4-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

Details for the file minimalllm-1.0.4.tar.gz.

File metadata

  • Download URL: minimalllm-1.0.4.tar.gz
  • Upload date:
  • Size: 100.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.14

File hashes

Hashes for minimalllm-1.0.4.tar.gz
Algorithm Hash digest
SHA256 1df00d31de57b65f61c0e1fd85567a5200d74967eeb22d1e284000b8f3bdbe9b
MD5 81760f4676c67eec87857a0a3fa1c08d
BLAKE2b-256 77bf6cd5ab57402a554cd35aa4b916444c47272a13848a1a9ecfad2d6ab88925

See more details on using hashes here.

File details

Details for the file MinimalLLM-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: MinimalLLM-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 20.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.14

File hashes

Hashes for MinimalLLM-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0ef9da3f0ac020baa145a0aef3020e83e1353eb549e77cec10afe2cb20f1e403
MD5 d83af35d783ad299f417b95bca843a1a
BLAKE2b-256 345a3c37a228ea9ea672dde6c40bd53ecd8bd4596f1fe30f5f9dbe51810c2f74

See more details on using hashes here.

Supported by

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