Fosowl/agenticSeek · error · Exception
LiteLLM is not available for local use. Change config.ini
Error message
LiteLLM is not available for local use. Change config.ini
What it means
litellm_fn explicitly rejects local configurations: if the provider was constructed with is_local=True (a local model chosen in config.ini), it raises a plain Exception saying LiteLLM routing is only for cloud providers. LiteLLM completion here always targets hosted APIs via model prefixes, so local backends are unsupported by design.
Solutions
- Edit config.ini and switch the provider away from local mode (set is_local/local flag off and pick a cloud model)
- Use the dedicated local-model code path in LLMProvider instead of litellm_fn
- Instantiate a separate LLMProvider configured for a cloud provider when you need LiteLLM routing
Example fix
// before (config.ini) [PROVIDER] provider = litellm local = true // after (config.ini) [PROVIDER] provider = litellm local = false model = openai/gpt-4o-mini
Defensive patterns
Strategy: validation
Validate before calling
if provider.is_local:
raise SystemExit('litellm_fn requires a cloud provider: set local = false in config.ini') Try / catch
try:
thought = provider.litellm_fn(history)
except Exception as e:
if 'not available for local use' in str(e):
logger.error('Fix config.ini: LiteLLM cannot serve local models here')
raise Prevention
- Check provider.is_local before selecting the litellm backend
- Keep config.ini provider/local settings consistent with the code path you call
- Document that local models use a separate pipeline in this library
- Validate config.ini at startup, before any LLM calls
When it happens
Trigger: Calling LLMProvider.litellm_fn(history) when the provider instance was built from a config.ini entry selecting a local model (is_local=True).
Common situations: Developer flips the provider to litellm in config.ini but leaves `local = true` / local model settings; reusing one provider object across local and cloud pipelines; misunderstanding that litellm can proxy Ollama-style local endpoints in this wrapper.
Related errors
- API key not found in .env file. Please add it to your .env…
- Deepseek (API) is not available for local use. Change…
- Google Gemini is not available for local use. Change…
- LiteLLM API error
- litellm is not installed. Install with: pip install litellm
AI-assisted analysis of Fosowl/agenticSeek@ae57a23577 (2026-08-30).
Data as JSON: /api/errors/213edf97e86bef65.
Report an issue: GitHub.
Appendix: source
Thrown at sources/llm_provider.py:522
raise NetworkError("Network error occurred. Check your internet connection.") from e
except APIError as e:
raise APIError(f"API error occurred: {str(e)}") from e
return None
def litellm_fn(self, history, verbose=False):
"""
Use LiteLLM AI gateway for completion.
Routes to 100+ providers (OpenAI, Anthropic, Azure, Bedrock,
Vertex AI, Groq, Together, Ollama, etc.) based on model prefix.
See https://docs.litellm.ai/docs/providers
"""
try:
import litellm
except ImportError as e:
raise ImportError("litellm is not installed. Install with: pip install litellm") from e
if self.is_local:
raise Exception("LiteLLM is not available for local use. Change config.ini")
api_key = os.getenv("LITELLM_API_KEY", None)
try:
call_kwargs = {
"model": self.model,
"messages": history,
"drop_params": True,
}
if api_key:
call_kwargs["api_key"] = api_key
response = litellm.completion(**call_kwargs)
if response is None:
raise Exception("LiteLLM response is empty.")
thought = response.choices[0].message.content
if verbose:
print(thought)
return thoughtView on GitHub (pinned to ae57a23577)