simple-infer
Minimal, hackable batch inference library for LLMs. No batch endpoints needed.
Installation
pip install simple-infer
Usage
from simple_infer import infer
conversations = [
[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is the capital of France?"},
],
[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is 2+2?"},
]
]
results = infer(conversations, model="gpt-4.1-nano", max_concurrent=32)
Features
- Simple: Two main functions -
infer()andcall_llm() - Fast: Async batch processing with configurable concurrency
- Reliable: Built-in retries with exponential backoff
- Hackable: Clean, readable code you can modify
Development
Setup
# Clone and install dependencies
uv sync --extra test --extra docs
# Copy environment template and add your OpenAI API key
cp .env.example .env
# Edit .env and add: OPENAI_API_KEY=your-key-here
Testing
# Run tests (requires OPENAI_API_KEY in environment)
export OPENAI_API_KEY=your-key-here
uv run pytest tests/ -v
# Or use .env file
uv run pytest tests/ -v
Metadata
Release files for simple-infer 0.1.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 | |
|---|---|---|---|
| simple_infer-0.1.0.tar.gz | 33.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| simple_infer-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 37.7 kB
Release files / simple_infer-0.1.0.tar.gz
| Download URL | simple_infer-0.1.0.tar.gz |
|---|---|
| Size | 33.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
826a552a7e8e0d1d25e247364002fe4fe6553d2ae4733d359d025b7c79e15b1b
|
|
BLAKE2b-256 checksum How to use checksums |
df3ee7e8b3f51ae3de733347f2ffb1061a8d00172440b95cb242b891279665df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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 Jul 21, 2025.
Transparency logRelease files / simple_infer-0.1.0-py3-none-any.whl
| Download URL | simple_infer-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9ed667c44b426cfabfa688bb42bede3fd54472b197fe1327dc99b9779e63d024
|
|
BLAKE2b-256 checksum How to use checksums |
3ee895b04cb3426ec7c993ddcaec21f881d13d3aea835551d3c63b91c0602f8f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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 Jul 21, 2025.
Transparency log