Environment:ARCANGEL0 EVA LLM Provider Endpoint
| Knowledge Sources | |
|---|---|
| Domains | Infrastructure, LLMs, Security |
| Last Updated | 2026-10-29 12:00 GMT |
Overview
Configured LLM provider endpoint (OpenAI, Anthropic, OpenRouter, Ollama, DeepSeek, Moonshot, NVIDIA NIM, Cloudflare, or custom) with API key and model selection.
Description
This environment defines the LLM provider configuration that Mitsu needs to run agent turns. It requires a configured provider profile stored in `~/.config/mitsu/credentials.json` containing a `base_url`, `model`, `api_key` (for most providers), and `protocol` (either `"openai"` or `"anthropic"`). Supported providers include OpenAI, Anthropic, OpenRouter, Ollama (local, no key), DeepSeek, Moonshot, NVIDIA NIM, Cloudflare Models (requires account_id in URL), and Custom endpoints. The provider dispatch supports streaming, reasoning parameters, and tool-calling for both OpenAI-compatible and Anthropic protocols.
Usage
Use this environment for any agent turn execution, model listing, or reasoning capability check. It is the mandatory prerequisite for `run_agent_turn`, `request_agent_turn`, `list_models`, and `check_reasoning_support`. Without a configured and valid provider profile, Mitsu cannot start any agent session.
System Requirements
| Category | Requirement | Notes |
|---|---|---|
| Network | HTTPS access to provider endpoint | Required for cloud providers; Ollama uses localhost |
| Provider Account | API key for cloud providers | Ollama and Custom do not require a key |
Dependencies
System Packages
None beyond the base Python environment.
Python Packages
- `urllib.request` (stdlib, used for HTTP — no external HTTP library needed)
Credentials
The following credentials are stored in `~/.config/mitsu/credentials.json` (mode 0o600):
- `api_key`: Provider API key (OpenAI, Anthropic, OpenRouter, DeepSeek, Moonshot, NVIDIA NIM, Cloudflare, or search engine keys)
- `base_url`: Provider endpoint URL
- `model`: Selected model identifier
- `protocol`: `"openai"` or `"anthropic"`
For search engine API keys (stored in the same credentials file under `search_engines`):
- `api_key`: Required by Exa, Tavily, Ollama Search, Brave API, Serper, SerpApi, Firecrawl
- `search_engine_id`: Required by Google Programmable Search (in addition to `api_key`)
Quick Install
# No pip install needed — Mitsu uses stdlib urllib
# Configure a provider through Mitsu's onboarding wizard or:
# Edit ~/.config/mitsu/credentials.json with your provider profile
Code Evidence
Provider profile validation from `providers/client.py:145-146`:
if not base_url or not model:
raise ProviderRequestError("Provider setup is incomplete. Reopen provider setup from the main menu.")
Provider definitions from `config/catalog.py:18-34`:
PROVIDERS = (
ProviderSpec("openai", "OpenAI", "https://api.openai.com/v1", "openai"),
ProviderSpec("anthropic", "Anthropic", "https://api.anthropic.com", "anthropic"),
ProviderSpec("openrouter", "OpenRouter", "https://openrouter.ai/api/v1", "openai"),
ProviderSpec("ollama", "Ollama", "http://localhost:11434/v1", "openai", False),
ProviderSpec("deepseek", "DeepSeek", "https://api.deepseek.com", "openai"),
ProviderSpec("custom", "Custom", "", "openai", False),
)
Credential readiness check from `config/storage.py:92-101`:
def ready(self) -> bool:
profile = self.active()
if not profile or not profile.get("model") or not profile.get("base_url"):
return False
spec = PROVIDER_BY_ID.get(str(profile.get("provider_id")))
if not spec:
return False
if spec.requires_api_key and not profile.get("api_key"):
return False
return True
Common Errors
| Error Message | Cause | Solution |
|---|---|---|
| `Provider setup is incomplete` | Missing base_url or model | Reopen provider setup from the main menu |
| `Provider request failed (429)` | Rate limited by provider | Mitsu auto-retries up to 10 times with 10s delay |
| `Provider request failed (5xx)` | Provider server error | Mitsu auto-retries transient 5xx errors |
| `could not reach the provider` | Network issue or wrong base_url | Check network and provider endpoint URL |
Compatibility Notes
- Ollama: Local provider, no API key required, uses `http://localhost:11434/v1`.
- Cloudflare Models: Requires `{account_id}` placeholder in `base_url` to be replaced.
- Custom endpoints: Any OpenAI- or Anthropic-compatible endpoint can be configured.
- Protocol dispatch: Anthropic protocol uses `tool_use`/`tool_result` blocks; OpenAI protocol uses `tool_calls`/`tool` messages.
- Reasoning support: Different providers use different reasoning parameters (`reasoning_effort`, `reasoning`, `nvidia_chat_template`).