#94
feat(llm): add named OrcaRouter provider (orcarouter/* model aliases)
Summary
Adds first-class support for OrcaRouter as a named provider. Models using an orcarouter/* alias (e.g. orcarouter/auto) now route through the OrcaRouter OpenAI-compatible gateway at https://api.orcarouter.ai/v1 using ORCAROUTER_API_KEY, mirroring the existing openai/ relay pattern already used for custom API bases.
It also runs gateway-level, zero-trust security for AI agents on the same endpoint — screening every prompt/response and governing every tool call on a default-deny basis, with no application code changes.
What changed
pentestagent/llm/llm.py:_is_orcarouter_model()detection +_apply_orcarouter()which injectscustom_llm_provider="openai",api_base, andapi_keyfororcarouter/*models. Wired intogenerate,generate_stream, and_summarize_call.get_available_models()includesorcarouter/autoandorcarouter/fusion.pentestagent/llm/config.py/pentestagent/config/settings.py:orcarouter_api_base(defaults tohttps://api.orcarouter.ai/v1, override viaORCAROUTER_BASE_URL) andorcarouter_api_key(ORCAROUTER_API_KEY). Key is masked inrepr/str.pentestagent/config/constants.py:ORCAROUTER_API_BASE+get_orcarouter_api_base().pentestagent/knowledge/embeddings.py:orcarouter/*embedding models route through the gateway;should_use_local_embeddings()recognizesORCAROUTER_API_KEY..env.example/README.md: documented the named OrcaRouter provider with a config example and a Docker run example.- Tests: prefix detection, routing kwargs (chat + stream + embeddings), env defaults, non-OrcaRouter isolation, and key masking.
Verification
pytest tests/unit/ tests/security/— 627 passed (includes new orcarouter tests)ruff checkon all changed files — clean- Black: no new violations vs upstream (CI runs black with
continue-on-error) - L3 live test with a real OrcaRouter key through the production
LLMpath (orcarouter/auto→https://api.orcarouter.ai/v1): non-streaming returnedORCA-OK, streaming returnedSTREAM-OK
Disclosure: I'm an engineer on the OrcaRouter team.