Skip to main content

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 streamlit app (run pip install streamlit first):

from mllm.setup import run_setup_app
run_setup_app()

Why minimal?

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

Release files for MinimalLLM 1.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for MinimalLLM 1.2.2
File Size Uploaded
minimalllm-1.2.2.tar.gz 107.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for MinimalLLM 1.2.2
File Interpreter ABI Platform
minimalllm-1.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 136.4 kB

Release files / minimalllm-1.2.2.tar.gz

Download URL minimalllm-1.2.2.tar.gz
Size 107.9 kB
Tags Source
SHA-256 checksum
How to use checksums
db4e98eb6e0e5f3f39469a2df8a9dc1183287b0f55f3d36b4bd986d1aa3cd047
BLAKE2b-256 checksum
How to use checksums
7ab826cd134944bc7a20672be7631b031a18ebfd07dd52ca074a2ba551e7a54d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.16

Release files / minimalllm-1.2.2-py3-none-any.whl

Download URL minimalllm-1.2.2-py3-none-any.whl
Size 28.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
960238434dd96232510f818eeeb1e813a3a7d08549774b340e7aeafb99224aa8
BLAKE2b-256 checksum
How to use checksums
309579b15fb881f5a2d05679a6541287ed3f35af87dc6eae8f792b2a5b9f4e86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.16

Release history Release notifications | RSS feed

This release

1.2.2 This release

2 release files

1.2.1

2 release files

1.1.9

2 release files

1.1.8

2 release files

1.1.7

2 release files

1.1.5

2 release files

1.1.2

2 release files

1.1.0

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page