Pre-release · MIT licensed · building in the open

Call an LLM. Assemble a conversation. Watch it work.

PyWrapAI is a modular Python toolkit for production AI apps. One job per library, so swapping providers never touches how history is assembled.

$git clone https://github.com/js-deepakgiduthuri/PyWrapAI-library && cd PyWrapAI-library && pip install -e .

Not yet published to PyPI — pip install pywrapai is coming with the first tagged release.

from pywrapai import LLM

llm = LLM(provider="anthropic")
response = llm.chat(
    "What is the capital of France?"
)

print(response.content)
# Paris is the capital of France.

print(response.usage.input_tokens)
# 14

print(llm.tokens.total_cost)
# 0.000018
Comparison

Why not just use LangChain?

LangChain and LangGraph do the same job with more moving parts. PyWrapAI trims the indirection.

LangChain + LangGraphPyWrapAI
Composition modelChains, runnables, graphsTwo plain classes
Provider swapA package per providerOne `provider=` argument
Cost trackingA separate SDKBuilt into every call
Install footprintOne large packageOnly what you need
BehaviorHidden abstractionsExplicit, visible Python
Feature set

Everything a production LLM app needs

Nothing it doesn’t. Every behavior here is explicit, visible Python.

4 providers, 1 interface

OpenAI, Anthropic, Gemini, Ollama — one class.

Token & cost tracking

Every call recorded. Cost from one price table.

Structured output

Pydantic-validated JSON, native mode where supported.

Retry + fallback

Backoff on errors, then a full fallback model.

Response caching

SHA-256 keyed, thread-safe, swappable backend.

Async-first

`achat()` and `astream()` on every method.

RAG pipeline

Chunk, embed, retrieve — 6 store backends.

ReAct agent loop

Tool calls with a configurable turn limit.

Typed errors

One except clause instead of five.

Examples

Templates to build from

Full example apps built with PyWrapAI — not snippets.

Coming soon

Support Chatbot

PyQt5 desktop app

Login, versioned prompts, live token + cost panel.

Coming soon

RAG Knowledge Assistant

Retrieval-augmented chatbot

Ask questions over your own documents.

Coming soon

Retail Analytics Agent

Flask + ReAct agent

A tool-calling agent over a sales database.

See all templates →

Ready to try it?

Start with the tutorial — a working chatbot in about ten minutes.