BatchedLLM
like itertools.batched but for calling LLM
What? Why? How?
This is a wrapper for any async client to limit amount of concurent requests. More features are planned, like caching and budget restrictions.
Sometimes you work with large dataset and model with mixed reasoning where one requst responds immidiately while another waits for what feels like eternity. This tool helps you minimize time waiting while adding some usefull features, like error handling (more features are planned).
The principle behind is overwriting python attribute getters (getattrs) and call functions (call) and storing them till later evaluation. This also means that clients can change, but the tool doesn't need to. The intended use is for LLM clients to limit concurency, but, theoretically, and async object can be wrapped to limit its concurency and manage errors.
Example
Run the OpenAI speed comparison example with uv --script:
OPENAI_BASE_URL=<url or https://api.openai.com/v1> OPENAI_MODEL=<model or gpt-5-nano> OPENAI_API_KEY=sk-... uv run --script examples/openai_speed.py
Metadata
Release files for batchedllm 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| batchedllm-0.3.0.tar.gz | 20.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| batchedllm-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.0 kB
Release files / batchedllm-0.3.0.tar.gz
| Download URL | batchedllm-0.3.0.tar.gz |
|---|---|
| Size | 20.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
80d0f2695c6dc4e1022f13972693c90be58376125b297900a3f1bf8923026d86
|
|
BLAKE2b-256 checksum How to use checksums |
05a812b027b122964f04e71483a09f8b7c101fad0e0f8a0dba9fce85d272e320
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 1, 2026.
Transparency logRelease files / batchedllm-0.3.0-py3-none-any.whl
| Download URL | batchedllm-0.3.0-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
55615ae984d8486467eaffa032b32dc9030323a49b96e00d9cc155e5fc5c0b7b
|
|
BLAKE2b-256 checksum How to use checksums |
875d3d4138e75d76078d9b490af3007d021034983c15f4c2d2039a45731610b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 1, 2026.
Transparency log