Skip to main content

LLM Wrapper

A flexible wrapper for LLM providers with caching, async support, and cost logging.

https://pypi.org/project/llm-wrapper-yl/

Installation

pip install llm-wrapper-yl

Quick Start

from llm_wrapper import Provider

# Initialize the provider
provider = Provider(model="gpt-4o-mini")

# Generate a single response
response = provider.generate("What is the capital of France?")

# Generate multiple responses with caching
responses = provider.generate(
    ["What is 2+2?", "What is the weather?"],
    system_prompt="You are a helpful assistant.",
    temperature=0.7
)

# For the second call, you will retrieve responses from cache
responses = provider.generate(
    ["What is 2+2?", "What is the weather?"],
    system_prompt="You are a helpful assistant.",
    temperature=0.7
)

Usage with Local Models

from llm_wrapper import Provider

# Initialize the provider with a local model
provider = Provider(
    model="your-model-name",
    host="your-server-host",
    port=8000
)

# Generate responses
responses = provider.generate(["Your prompt here"])

Testing

# Install local package with test dependencies
uv pip install '.[test]'
# Run tests with output
python -m pytest -s tests

Deploying

hatch build
twine upload dist/*

Metadata

Release files for llm-wrapper-yl 0.1.3

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

Source distribution (sdist)

Source distribution for llm-wrapper-yl 0.1.3
File Size Uploaded Provenance
llm_wrapper_yl-0.1.3.tar.gz 67.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for llm-wrapper-yl 0.1.3
File Interpreter ABI Platform
llm_wrapper_yl-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 75.1 kB

Release files / llm_wrapper_yl-0.1.3.tar.gz

Download URL llm_wrapper_yl-0.1.3.tar.gz
Size 67.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7abcc3c1d29280451c3876966752e64f79bf464b72cac67c392599b892795a0d
BLAKE2b-256 checksum
How to use checksums
05c0d08f5e88cbae27f84d2d5d72350911a0bde9bce69ac8614c4a0d6b727f94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.2

Release files / llm_wrapper_yl-0.1.3-py3-none-any.whl

Download URL llm_wrapper_yl-0.1.3-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6cd516dfb6c58bac36ec39466214622e9b09938325f9424db88b5ef0b7a98d6d
BLAKE2b-256 checksum
How to use checksums
bcdcb90f684f7158fe7e5dbd580156972027e29f387f97175b02d1a2ba7d082c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.2

Security for llm-wrapper-yl 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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