r/madeinpython • u/agam_more • Jul 22 '25
I built a Python library for AI batch requests - 50% cost savings
I recently needed to send complex batch requests to LLM providers (Anthropic, OpenAI) for a few projects, but couldn't find a robust Python library that met all my requirements - so I built one!
Batch requests can return a result in up to 24h - in return they reduce the costs to 50% of the realtime prices.
Key features:
- Batch requests to Anthropic & OpenAI (new contributions welcome!)
- Structured outputs
- Automatic cost tracking & configurable limits
- State resume for network interruptions
- Citation support (currently Anthropic only)
It's great for:
- Document extraction at scale (essp with citations enabled)
- Image classification
- ... anything where processing LLM requests at scale isn't urgent and cost optimization is helpful.
It's open-source, under active development (breaking changes might be introduced!). Contributions and feedback are very welcome!
GitHub repo: https://github.com/agamm/batchata (MIT)