Minimal, hackable batch inference library for LLMs
Project description
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
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 simple_infer-0.1.0.tar.gz.
File metadata
- Download URL: simple_infer-0.1.0.tar.gz
- Upload date:
- Size: 33.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
826a552a7e8e0d1d25e247364002fe4fe6553d2ae4733d359d025b7c79e15b1b
|
|
| MD5 |
79a57b5aee7ee3bbfa5df4aade14e89e
|
|
| BLAKE2b-256 |
df3ee7e8b3f51ae3de733347f2ffb1061a8d00172440b95cb242b891279665df
|
Provenance
The following attestation bundles were made for simple_infer-0.1.0.tar.gz:
Publisher:
python-publish.yml on sumukshashidhar/simple-infer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simple_infer-0.1.0.tar.gz -
Subject digest:
826a552a7e8e0d1d25e247364002fe4fe6553d2ae4733d359d025b7c79e15b1b - Sigstore transparency entry: 299888673
- Sigstore integration time:
-
Permalink:
sumukshashidhar/simple-infer@2cad8693fd67eca5e3ea9344dca8185312b8557a -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/sumukshashidhar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@2cad8693fd67eca5e3ea9344dca8185312b8557a -
Trigger Event:
release
-
Statement type:
File details
Details for the file simple_infer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: simple_infer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ed667c44b426cfabfa688bb42bede3fd54472b197fe1327dc99b9779e63d024
|
|
| MD5 |
43835a73e2684536893f3646d2034e1c
|
|
| BLAKE2b-256 |
3ee895b04cb3426ec7c993ddcaec21f881d13d3aea835551d3c63b91c0602f8f
|
Provenance
The following attestation bundles were made for simple_infer-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on sumukshashidhar/simple-infer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simple_infer-0.1.0-py3-none-any.whl -
Subject digest:
9ed667c44b426cfabfa688bb42bede3fd54472b197fe1327dc99b9779e63d024 - Sigstore transparency entry: 299888697
- Sigstore integration time:
-
Permalink:
sumukshashidhar/simple-infer@2cad8693fd67eca5e3ea9344dca8185312b8557a -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/sumukshashidhar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@2cad8693fd67eca5e3ea9344dca8185312b8557a -
Trigger Event:
release
-
Statement type: