A unified toolkit for working with multiple LLM providers
Project description
llm-kit-pro
llm-kit-pro is a unified, async-first Python toolkit for interacting with multiple Large Language Model (LLM) providers through a consistent, provider-agnostic API.
It supports:
- Multiple LLM providers (OpenAI, Gemini, Anthropic, etc.)
- Text and structured JSON generation
- Multimodal inputs (PDFs, images, text files)
- Clean abstractions and strong typing
✨ Core Ideas
1. Outputs are explicit
LLMs generate outputs, not OCR results.
llm-kit-pro exposes two primary operations:
generate_text→ free-form textgenerate_json→ structured, schema-driven output
2. Inputs can be text and/or files
Files (PDFs, images, etc.) are first-class inputs and can be passed directly to generation methods.
OCR and file parsing are treated as provider implementation details.
📦 Installation
pip install llm-kit-pro
Optional provider support (example):
pip install llm-kit-pro[openai]
pip install llm-kit-pro[gemini]
🚀 Quick Start
Text-only generation
text = await llm.generate_text(
prompt="Explain what power factor is in simple terms"
)
Text generation with a file (PDF, image, etc.)
from llm_kit_pro.core import LLMFile
pdf = LLMFile(
content=pdf_bytes,
mime_type="application/pdf",
filename="bill.pdf",
)
summary = await llm.generate_text(
prompt="Summarize this electricity bill",
files=[pdf],
)
Structured JSON extraction using Pydantic models
from pydantic import BaseModel
from typing import Optional
class BillDetails(BaseModel):
consumer_name: str
bill_amount: float
due_date: Optional[str] = None
data = await llm.generate_json(
prompt="Extract billing details from this document",
schema=BillDetails.model_json_schema(),
files=[pdf],
)
🧠 Design Philosophy
- Provider-agnostic: No OpenAI/Gemini specifics in the public API
- Async-first: Built for modern Python backends
- Composable: Easy to plug into pipelines (FastAPI, background jobs, ETL)
- Explicit contracts: Clear separation of inputs, outputs, and providers
🧩 Core Abstractions
BaseLLMClient
All providers implement the same interface:
class BaseLLMClient:
async def generate_text(...)
async def generate_json(...)
LLMFile
A provider-agnostic representation of file inputs:
from llm_kit_pro.core import LLMFile
🔌 Providers
Each provider is implemented as an adapter that conforms to BaseLLMClient.
Supported / planned:
- OpenAI
- Gemini
- Anthropic
- Bedrock
- Local / OSS models (future)
📍 Status
🚧 Under active development
The public API is stabilizing. Expect rapid iteration until v1.0.
📄 License
MIT License
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
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 llm_kit_pro-0.2.5.tar.gz.
File metadata
- Download URL: llm_kit_pro-0.2.5.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.11.14 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d5fbe3f896c8262d54797d2b34cfbdb8610d11ec658d41c82302e15c8eb899b
|
|
| MD5 |
19af0f49f56a9ed53d6ea3f8434f4847
|
|
| BLAKE2b-256 |
5f6621f1592d52e815ab4354d40624b8f425a9fad9a9f45b22507d0734515306
|
File details
Details for the file llm_kit_pro-0.2.5-py3-none-any.whl.
File metadata
- Download URL: llm_kit_pro-0.2.5-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.11.14 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd7f1460bebe0fe0f28fd274a5775db547e9e3275043c376d4efad39b2415538
|
|
| MD5 |
87355e9003c4b97a04e33308966fed2f
|
|
| BLAKE2b-256 |
ea498025a8ece24d67b591b101a3f52a8cf04416b0be42e813f9eeb904511044
|