A lightweight multi-provider wrapper for LLM chat with history and token management.
Project description
Wrapper4AI
Multi-provider, pluggable LLM wrapper with token counting, history management, and seamless extensibility.
🔧 Designed for developers building chat-based AI tools with OpenAI, Gemini, Bedrock, DeepSeek, Anthropic, and more.
🚀 Features
- 🔌 Unified interface for multiple LLM providers
- 💬 Chat history tracking with token trimming
- 🔢 Token counting with Tiktoken for OpenAI models
- 📚 Extensible handler base for adding new models
- ✅ Testable client API with clean abstraction
🛠️ Installation
pip install git+https://github.com/DKethan/Wrap4AI.git
Or if you package it to PyPI:
pip install wrapper4AI
🧩 Supported Providers
- ✅ OpenAI (
gpt-4o,gpt-3.5, ... all OpenAI language models ) - ✅ Google Gemini -> yet to be released
- ✅ Amazon Bedrock -> yet to be released
- ✅ DeepSeek -> yet to be released
- ✅ Meta LLaMA -> yet to be released
- ✅ HuggingFace -> yet to be released
- ✅ Anthropic Claude -> yet to be released
- ✅ Perplexity AI -> yet to be released
🔧 Usage
1. Connect to a provider
from wrapper4AI.wrap import connect
client = connect(provider="openai", model="gpt-4o", api_key="sk-xxx")
2. Basic Chat
response = client.chat("Tell me a joke.")
print(response)
3. With History
history = [
{"role": "user", "content": "What is Python?"},
{"role": "assistant", "content": "A programming language."},
{"role": "user", "content": "Who created it?"}
]
print(client.chat_with_history(history))
🧪 Testing
python -m tests.test_openai_001 # make sure to add your api key in the test file
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 wrapper4ai-0.1.1.tar.gz.
File metadata
- Download URL: wrapper4ai-0.1.1.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ba162423cfa78dfb14ddd0402cd9c1f1c8544f93d3e14c396780df212d777ff
|
|
| MD5 |
55978c89cef98b4bc59f1439da891a04
|
|
| BLAKE2b-256 |
559dc2275295b3375227cfa9da18afe9898a195472c0402171780f041356283d
|
File details
Details for the file Wrapper4AI-0.1.1-py3-none-any.whl.
File metadata
- Download URL: Wrapper4AI-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14267ce56546aef6e3323f0030c164851a883ec743d5964378053c14572db749
|
|
| MD5 |
8dcd42a85c2b0e8760d3cf66c7c8d0f0
|
|
| BLAKE2b-256 |
e96f00a515f276937ab50836b44a0b06fd040842c127c7681797d46f36b1a262
|