Skip to main content

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
  • ✅ Amazon Bedrock
  • ✅ DeepSeek
  • ✅ Meta LLaMA
  • ✅ HuggingFace Interface
  • ✅ Anthropic Claude
  • ✅ Perplexity AI
  • ✅ HuggingFace

🔧 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wrapper4ai-0.1.2.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

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

Wrapper4AI-0.1.2-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file wrapper4ai-0.1.2.tar.gz.

File metadata

  • Download URL: wrapper4ai-0.1.2.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for wrapper4ai-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a1d3a581898b0797fc21b6cb85ff4266b8bcfc314ba6121a6824c04ea79a2c60
MD5 5ac68b5892cc70d4178387278974fb18
BLAKE2b-256 4b587324f30d0c76cca3a781f253974b13db4f807962102ebadd5be25550def5

See more details on using hashes here.

File details

Details for the file Wrapper4AI-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: Wrapper4AI-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for Wrapper4AI-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 00ea515bb0251c242a3c29491b8dc52abd0ec527b592671eeafe9f0d35cea02e
MD5 f79c8c19c13a2053e4f66b778f24bccd
BLAKE2b-256 19cabfc279794892a05316bb896c776543502da133e4769f90868ffd8d36ea83

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