like itertools.batched but for calling LLM
Project description
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
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 batchedllm-0.3.0.tar.gz.
File metadata
- Download URL: batchedllm-0.3.0.tar.gz
- Upload date:
- Size: 20.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80d0f2695c6dc4e1022f13972693c90be58376125b297900a3f1bf8923026d86
|
|
| MD5 |
ee5e421aff5bac2505ad243690c81b01
|
|
| BLAKE2b-256 |
05a812b027b122964f04e71483a09f8b7c101fad0e0f8a0dba9fce85d272e320
|
Provenance
The following attestation bundles were made for batchedllm-0.3.0.tar.gz:
Publisher:
release_and_publish.yml on batchedllm/batchedllm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
batchedllm-0.3.0.tar.gz -
Subject digest:
80d0f2695c6dc4e1022f13972693c90be58376125b297900a3f1bf8923026d86 - Sigstore transparency entry: 1209542884
- Sigstore integration time:
-
Permalink:
batchedllm/batchedllm@79e3588c7313b809fc659ec257f8253b5bc32424 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/batchedllm
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release_and_publish.yml@79e3588c7313b809fc659ec257f8253b5bc32424 -
Trigger Event:
push
-
Statement type:
File details
Details for the file batchedllm-0.3.0-py3-none-any.whl.
File metadata
- Download URL: batchedllm-0.3.0-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55615ae984d8486467eaffa032b32dc9030323a49b96e00d9cc155e5fc5c0b7b
|
|
| MD5 |
2da5ab226c49545332abfc0272807329
|
|
| BLAKE2b-256 |
875d3d4138e75d76078d9b490af3007d021034983c15f4c2d2039a45731610b8
|
Provenance
The following attestation bundles were made for batchedllm-0.3.0-py3-none-any.whl:
Publisher:
release_and_publish.yml on batchedllm/batchedllm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
batchedllm-0.3.0-py3-none-any.whl -
Subject digest:
55615ae984d8486467eaffa032b32dc9030323a49b96e00d9cc155e5fc5c0b7b - Sigstore transparency entry: 1209542929
- Sigstore integration time:
-
Permalink:
batchedllm/batchedllm@79e3588c7313b809fc659ec257f8253b5bc32424 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/batchedllm
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release_and_publish.yml@79e3588c7313b809fc659ec257f8253b5bc32424 -
Trigger Event:
push
-
Statement type: