Async LLM router across AWS Bedrock and Google Gemini providers
Project description
llm-verse-avneesh
Async LLM router across AWS Bedrock (Claude, Amazon Nova) and Google Gemini.
A single Router.get_response(...) call validates its input, dispatches to
the requested model by name, and always returns a plain dict shaped like
LLMResponse — regardless of which
underlying provider handled the call.
Install
pip install "llm-verse-avneesh[aws]" # Bedrock (Claude, Nova) only
pip install "llm-verse-avneesh[google]" # Gemini only
pip install "llm-verse-avneesh[all]" # both
Usage
import asyncio
from llm_verse_avneesh import Router
async def main():
router = Router()
result = await router.get_response(
llm_name="nova-lite",
system_prompt="You are a helpful assistant.",
user_prompt="Say hello in one sentence.",
context=None,
temperature=0.5,
pydantic_model=None,
max_tokens=200,
repo_name="my-repo",
llm_identifier="greeting-1",
region_name="us-east-1",
aws_access_key_id="...",
aws_secret_access_key="...",
)
print(result["response"])
asyncio.run(main())
For Gemini, pass google_api_key instead of the AWS credential fields.
Registered model names
Registry keys match the name each provider documents publicly for the model — not an internal AWS/Anthropic model ID:
llm_name |
Provider | Notes |
|---|---|---|
claude-haiku-4-5 |
Bedrock | plain text / structured output |
claude-haiku-4-5-agentic |
Bedrock | tool-calling loop, pass tools=[...] |
nova-lite |
Bedrock | |
nova-2-lite |
Bedrock | |
nova-2-lite-grounding |
Bedrock | web grounding; US regions only |
nova-pro |
Bedrock | |
gemini-3.1-flash-lite |
Validation
LLMRequest(inmodels.py) does basic sanity checks: non-empty strings, non-negative temperature, positivemax_tokens, and that credentials for the selected provider are present.Router.get_responsethen enforces the actual per-model limits fromlimits.py— e.g. Gemini allows temperature up to 2.0 while the Bedrock models here cap at 1.0. Exceeding a model's limit raisesRouterValidationErrornaming the offending model and its limit. Updatelimits.pyif a provider changes its published limits.
Credentials
aws_secret_access_key and google_api_key are stored as pydantic.SecretStr
so they don't leak into repr(), str(), logs, or model_dump() output by
accident. Call .get_secret_value() only at the point where a client needs
the raw value.
Exceptions
All exceptions inherit from LLMRouterError:
RouterValidationError— bad input or a model-specific limit was exceeded.ProviderNotFoundError—llm_nameisn't registered.LLMCallError— the underlying provider call failed or raised.
Development
pip install -e ".[dev]"
pytest
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 llm_verse_avneesh-0.1.0.tar.gz.
File metadata
- Download URL: llm_verse_avneesh-0.1.0.tar.gz
- Upload date:
- Size: 19.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f232a4a1c276c7c909ab58a0d316fb79f9a39777dad5f8b98135e190faf1d7a
|
|
| MD5 |
0daf212582da763f076044b3590f6b10
|
|
| BLAKE2b-256 |
f6e91e2d9a15fcc947daff1dab297b9505ae5e1adb9517c629dc7d238ef5b251
|
Provenance
The following attestation bundles were made for llm_verse_avneesh-0.1.0.tar.gz:
Publisher:
publish.yml on avneeshrai07/llm-verse-avneesh
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_verse_avneesh-0.1.0.tar.gz -
Subject digest:
2f232a4a1c276c7c909ab58a0d316fb79f9a39777dad5f8b98135e190faf1d7a - Sigstore transparency entry: 2312635193
- Sigstore integration time:
-
Permalink:
avneeshrai07/llm-verse-avneesh@c7a99812510bb6b766db87ad79b77a1eb930e8c8 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/avneeshrai07
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c7a99812510bb6b766db87ad79b77a1eb930e8c8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file llm_verse_avneesh-0.1.0-py3-none-any.whl.
File metadata
- Download URL: llm_verse_avneesh-0.1.0-py3-none-any.whl
- Upload date:
- Size: 24.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afca95d965e739578bcf5ebb279bd424c58aa2e7eddd36e791004e6f0a0fdaf3
|
|
| MD5 |
add3dd6cb4f48bec089b4c0f106d09ab
|
|
| BLAKE2b-256 |
ca2883d2f86ea054a95c4d9c06b9c1268c0486a9c9cabf588d2788dc04850f70
|
Provenance
The following attestation bundles were made for llm_verse_avneesh-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on avneeshrai07/llm-verse-avneesh
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_verse_avneesh-0.1.0-py3-none-any.whl -
Subject digest:
afca95d965e739578bcf5ebb279bd424c58aa2e7eddd36e791004e6f0a0fdaf3 - Sigstore transparency entry: 2312635216
- Sigstore integration time:
-
Permalink:
avneeshrai07/llm-verse-avneesh@c7a99812510bb6b766db87ad79b77a1eb930e8c8 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/avneeshrai07
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c7a99812510bb6b766db87ad79b77a1eb930e8c8 -
Trigger Event:
release
-
Statement type: