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

Uploaded Source

Built Distribution

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

minimalllm-1.1.9-py3-none-any.whl (26.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: minimalllm-1.1.9.tar.gz
  • Upload date:
  • Size: 105.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.16

File hashes

Hashes for minimalllm-1.1.9.tar.gz
Algorithm Hash digest
SHA256 b97604ef9a2488190d11908383546ced739355e9d94d05262d2cb29bf54e9df2
MD5 cd13afe5578b2a4eec73c1a3e579d483
BLAKE2b-256 b0edf5e14e6e89ea1044973b84e32c62ffec9885c5199fb315f91804cff0eca3

See more details on using hashes here.

File details

Details for the file minimalllm-1.1.9-py3-none-any.whl.

File metadata

  • Download URL: minimalllm-1.1.9-py3-none-any.whl
  • Upload date:
  • Size: 26.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.16

File hashes

Hashes for minimalllm-1.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 0d06b525a78f78abc38bb6a795af0a992d9c0d02ca8be8f6929d2012e5148816
MD5 9c378f7185c3490af0334c8b39aa7c1c
BLAKE2b-256 86ec4a2298ecbe08590478a04a24c8cad5ff827b1899eadbde4d91fb0452bf1c

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