Skip to main content

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 llmwrap
# or
uv add llmwrap

Quick start

from 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


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

Uploaded Source

Built Distribution

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

amyrmahdy_llmwrap-0.1.0-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: amyrmahdy_llmwrap-0.1.0.tar.gz
  • Upload date:
  • Size: 19.0 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

Hashes for amyrmahdy_llmwrap-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4b52abed0980dee5de913f7adebefdc3e32228c871c26ec165e773572f96860d
MD5 63be1203884b8a5156ff91c86ee60e17
BLAKE2b-256 8161236e0f07319accb31a85fcdff4db9cbc9fd60b62d14cb8a29578ccdb54dc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: amyrmahdy_llmwrap-0.1.0-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

Hashes for amyrmahdy_llmwrap-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b2eaf0af27ca464303cdc228f7f82bc586dfe8afed57b6591bd72a648b20b5e9
MD5 f5a1a924547ca05cc9152bcd05967b5f
BLAKE2b-256 9b43092f0eed66e0becc18d01b6e84a1ccc8c37d8814711f70a6d1ed381afa37

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