Providers errors
Common error signatures
Errors in the providers module fall into two categories: missing optional SDK dependencies and invalid provider names passed to get_provider().
| Exception | Message pattern | Likely cause |
|---|---|---|
ValueError |
Unknown provider '{name}'. Known providers: {list}. |
You passed an unrecognized name to get_provider(). |
ImportError / ModuleNotFoundError |
(varies by SDK) | You instantiated ClaudeProvider or GeminiProvider without installing the required extra. |
Where errors originate
get_provider(name, **kwargs)— RaisesValueErrorifnamedoes not match any registered provider. The error message includes both the unknown name and the list of recognized provider names.ClaudeProvider.__init__()— Requires theattune-rag[claude]extra. If theanthropicSDK is not installed, constructing this class raises anImportError.GeminiProvider.__init__()— Requires theattune-rag[gemini]extra. If thegoogle-genaiSDK is not installed, constructing this class raises anImportError.list_available()— Returns only the providers whose SDKs are importable at call time. If this list is shorter than expected, a required extra is missing rather than an exception being raised.
How to diagnose
-
Check the provider name. If you see
ValueError: Unknown provider '...'. Known providers: ..., the name you passed toget_provider()is misspelled or not registered. Calllist_available()to see which providers are importable in the current environment. -
Verify the installed extras. If you get an
ImportErrorwhen constructingClaudeProviderorGeminiProvider, install the corresponding extra:ClaudeProvider→pip install attune-rag[claude]GeminiProvider→pip install attune-rag[gemini]
-
Confirm
list_available()output matches your expectations. If a provider you expect is absent from the returned list, its SDK is not importable — install the relevant extra and re-check. -
Check API key availability. Both
ClaudeProviderandGeminiProvideraccept anapi_keyargument. If you rely on environment-variable injection instead, confirm the variable is set before the provider is constructed.
Source files
src/attune_rag/providers/__init__.pysrc/attune_rag/providers/base.pysrc/attune_rag/providers/claude.pysrc/attune_rag/providers/gemini.py
Tags: providers, llm, claude, gemini