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.
Discovering models
Three callables let you explore what's registered without reading source:
import llm_verse_avneesh as lv
lv.help() # documents list_models(), model_info(), and Router.get_response()
lv.list_models() # [{"llm_name": "nova-lite", "display_name": "Amazon Nova Lite", "provider": "bedrock"}, ...]
lv.model_info("nova-lite") # required vs. optional arguments for that specific model
model_info(llm_name) returns exactly what that model needs and accepts —
e.g. Gemini models list google_api_key under required and never AWS
credentials; only models that actually implement an agentic tool-calling
loop (all chat models except nova-2-lite-grounding) list
tools/max_iterations under optional. It raises ProviderNotFoundError
for an unknown llm_name.
Registered model names
Registry keys match the name each provider documents publicly for the
model — not an internal AWS/Anthropic model ID. (See list_models() /
model_info() above for this same information at runtime.)
llm_name |
Provider | Notes |
|---|---|---|
claude-haiku-4-5 |
Bedrock | plain text / structured output; pass tools=[...] for an agentic tool-calling loop |
nova-lite |
Bedrock | plain text / structured output; pass tools=[...] for an agentic tool-calling loop |
nova-2-lite |
Bedrock | plain text / structured output; pass tools=[...] for an agentic tool-calling loop |
nova-2-lite-grounding |
Bedrock | web grounding; US regions only |
nova-pro |
Bedrock | plain text / structured output; pass tools=[...] for an agentic tool-calling loop |
gemini-3.1-flash-lite |
plain text / structured output; pass tools=[...] for an agentic tool-calling loop |
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.3.tar.gz.
File metadata
- Download URL: llm_verse_avneesh-0.1.3.tar.gz
- Upload date:
- Size: 22.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 |
e2c438880258cfc23330a7a989ba6f584a1bdefe6faac596f1b2e2f7d91058a1
|
|
| MD5 |
ff302ba629bb90444e025af6638a0989
|
|
| BLAKE2b-256 |
15b387598edb0b511c368057a54d130d0542a71e933a271378253964d9ac3afa
|
Provenance
The following attestation bundles were made for llm_verse_avneesh-0.1.3.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.3.tar.gz -
Subject digest:
e2c438880258cfc23330a7a989ba6f584a1bdefe6faac596f1b2e2f7d91058a1 - Sigstore transparency entry: 2313524714
- Sigstore integration time:
-
Permalink:
avneeshrai07/llm-verse-avneesh@9b7b2ff546bfa31a8cbb7304df7f5a07cf1e71d7 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/avneeshrai07
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9b7b2ff546bfa31a8cbb7304df7f5a07cf1e71d7 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file llm_verse_avneesh-0.1.3-py3-none-any.whl.
File metadata
- Download URL: llm_verse_avneesh-0.1.3-py3-none-any.whl
- Upload date:
- Size: 29.3 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 |
79d311c96862a4bd9b6938ba3289f0ab830780e9d0817b8fc74fdde20be71e7d
|
|
| MD5 |
94a0780fce3e89d4ee9727779fd8d82d
|
|
| BLAKE2b-256 |
6ef0ee784b3cf8af967a09157f3764049eb520d9350e7711cb82fbddbb4cf34f
|
Provenance
The following attestation bundles were made for llm_verse_avneesh-0.1.3-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.3-py3-none-any.whl -
Subject digest:
79d311c96862a4bd9b6938ba3289f0ab830780e9d0817b8fc74fdde20be71e7d - Sigstore transparency entry: 2313524721
- Sigstore integration time:
-
Permalink:
avneeshrai07/llm-verse-avneesh@9b7b2ff546bfa31a8cbb7304df7f5a07cf1e71d7 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/avneeshrai07
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9b7b2ff546bfa31a8cbb7304df7f5a07cf1e71d7 -
Trigger Event:
workflow_dispatch
-
Statement type: