A blazing-fast gateway for asynchronous, high-concurrency LLM requests (OpenAI, Claude, etc.).
Project description
FluxLLM
A blazing-fast gateway for asynchronous, high-concurrency LLM requests (OpenAI, Claude, etc.). Dynamically caches responses to slash latency and costs while scaling seamlessly across AI providers. Built for developers who demand speed without compromise.
Features
- Asynchronous, high-concurrency requests
- Dynamically caches responses to slash latency and costs
- Seamlessly scales across AI providers
- Simple to use
- Extensible to add new AI providers
Installation
pip install fluxllm
Usage
from fluxllm.clients import FluxOpenAI
client = FluxOpenAI(
base_url="https://api.openai.com/v1", # base url of the ai provider
api_key="sk-...", # api key of the ai provider
cache_file="/path/to/cache.jsonl", # path to the cache file
max_retries=3, # max retries for a request, set to None will retry infinitely
max_parallel_size=1024, # max 1024 requests concurrently
)
# request is a object that passed to the endpoint of the ai provider
request = {
"messages": [
{"role": "user", "content": "Hello, world!"},
],
"model": "gpt-4o",
"max_tokens": 100,
"temperature": 0.5,
"top_p": 1,
}
# requests is a list of requests
requests = [request] * 1000
# The list of responses maintains the same order as the input requests.
# If a request fails, its corresponding response will be None.
responses = client.request(requests)
# post-process the responses to get what you want
contents = [response.choices[0].message.content for response in responses]
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 fluxllm-0.1.1.tar.gz.
File metadata
- Download URL: fluxllm-0.1.1.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b9b6c18f1a8044eb837d736edc298b495987654f60842255b163ccf3c0baa66
|
|
| MD5 |
c8126bce1150b8e2ef107d07b9fd94a3
|
|
| BLAKE2b-256 |
70977467cda4a9f1ca99f84b309ea13e6ff076325b6de510c9ec8d6894824a2d
|
Provenance
The following attestation bundles were made for fluxllm-0.1.1.tar.gz:
Publisher:
publish-pypi.yaml on Hambaobao/fluxllm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fluxllm-0.1.1.tar.gz -
Subject digest:
0b9b6c18f1a8044eb837d736edc298b495987654f60842255b163ccf3c0baa66 - Sigstore transparency entry: 189518313
- Sigstore integration time:
-
Permalink:
Hambaobao/fluxllm@508a8eb0ccd505ec6827012779b3500e424cb0b4 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Hambaobao
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yaml@508a8eb0ccd505ec6827012779b3500e424cb0b4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file fluxllm-0.1.1-py3-none-any.whl.
File metadata
- Download URL: fluxllm-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.3 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 |
e99288fd1e28b7cc2f6561fcfd3468cdeafeafff6c4f8d082250c5ef461fc3b2
|
|
| MD5 |
65feaa761090e1617554bdb72e0702be
|
|
| BLAKE2b-256 |
53bac1ffe4436f2b0f3ba5b7f672cfc190c3c62380af10cd6677a6679332cda8
|
Provenance
The following attestation bundles were made for fluxllm-0.1.1-py3-none-any.whl:
Publisher:
publish-pypi.yaml on Hambaobao/fluxllm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fluxllm-0.1.1-py3-none-any.whl -
Subject digest:
e99288fd1e28b7cc2f6561fcfd3468cdeafeafff6c4f8d082250c5ef461fc3b2 - Sigstore transparency entry: 189518314
- Sigstore integration time:
-
Permalink:
Hambaobao/fluxllm@508a8eb0ccd505ec6827012779b3500e424cb0b4 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Hambaobao
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yaml@508a8eb0ccd505ec6827012779b3500e424cb0b4 -
Trigger Event:
push
-
Statement type: