Lightweight, production-ready adapter for LLM chat completions (text + multimodal)
Project description
llmwrap
Lightweight adapter for LLM chat completions — text, images, PDFs/files.
OpenAI-compatible (works great with OpenRouter, Anthropic via compat layer, etc.).
Installation
pip install amyrmahdy-llmwrap
# or
uv add amyrmahdy-llmwrap
Quick start
from amyrmahdy_llmwrap import LLM
llm = LLM(
api_key="sk-...",
base_url="https://openrouter.ai/api/v1",
model="anthropic/claude-3.5-sonnet",
)
# Text
print(llm.complete([{"role": "user", "content": "Hi!"}]))
# Image + text
messages = [
{"role": "user", "content": [
LLM.text_content("Describe this."),
LLM.image_content("photo.jpg"),
]}
]
print(llm.complete(messages))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
amyrmahdy_llmwrap-0.1.1.tar.gz
(29.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file amyrmahdy_llmwrap-0.1.1.tar.gz.
File metadata
- Download URL: amyrmahdy_llmwrap-0.1.1.tar.gz
- Upload date:
- Size: 29.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.1","id":"xia","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d541c3ad2123320483fdf94f31b08efdf73a8e54e467a6a7297c6ad9584f133
|
|
| MD5 |
43f205125341c382108705d46f694c96
|
|
| BLAKE2b-256 |
3afb28e57026319aee64f6d6035af21bbce2e999b8f23059be0fcd1881d28405
|
File details
Details for the file amyrmahdy_llmwrap-0.1.1-py3-none-any.whl.
File metadata
- Download URL: amyrmahdy_llmwrap-0.1.1-py3-none-any.whl
- Upload date:
- Size: 2.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.1","id":"xia","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc12d1d4658c64f382212dbe2a9225be269f55e7ef2ccc42937195755b0edeac
|
|
| MD5 |
a28c6269c39726b3a6c2bb02682720a9
|
|
| BLAKE2b-256 |
bb5eba10cdd1931a371725f5d68bdb4e6a226b473731ec4de90cad1ff489ced4
|