# Which models are supported and how are cost and context managed?

> Open-source AI pentest and offensive-security agents — a good answer covers: LLM providers and model configuration, per-role model selection, local model support, token or cost budgets, and context-window management.

Canonical page: https://llms-technical-reviews.com/offensive-security-agents/q/models/

## Verdict

Decepticon and RAPTOR have the most deliberate per-role model routing and cost controls, and Strix has the most practical shared spend budget. Most others support many providers but have no spend cap.

**Per-role models with spend caps.** [Decepticon](/p/decepticon/) sends every call through a LiteLLM proxy and maps each role to a HIGH, MID or LOW tier, with `eco`, `max` and `test` profiles. Its USD cap reads tagged spend from the proxy but is off until set. [RAPTOR](/p/raptor/) uses native Anthropic, OpenAI, Gemini and Mistral SDKs plus Ollama, assigns models to roles in `models.json`, and caps cost, calls, time and tokens, with $1 per Claude Code child. [Pentest Swarm AI](/p/pentest-swarm-ai/) supports ten providers, gives cheaper models to recon and report on some gateways, and stops a campaign at `--budget`. Each agent call is a fresh bounded prompt, and refusals can be retried on a fallback provider. [Nebula](/p/nebula/) lists 25 provider kinds plus Codex and Grok harnesses, and compacts at 75% of a 200K working ceiling. Its run budgets default to unbounded.

**Shared model, limited budgets.** [Strix](/p/strix/) takes any LiteLLM model plus an optional separate dedupe model, and enforces one dollar budget across the agent tree, set to stop or pause. [PentAGI](/p/pentagi/) offers 13 provider types with per-role models and records cost per chain. [CyberStrike](/p/cyberstrike/) inherits opencode's models.dev catalogue and lets an agent drop to the provider's small model. [RedAmon](/p/redamon/) picks the provider from the model-id prefix and supports Anthropic prompt caching. One model drives the agent. [PentestAgent](/p/pentestagent/) shares one LiteLLM model across crew workers and summarises history past 60% of its token budget. [Shannon](/p/shannon/) runs one model for every agent (default `anthropic:claude-sonnet-4-6`) with no budget. Apart from Strix, nothing in this group stops on spend.

**Restricted or not applicable.** [PentestGPT](/p/pentestgpt/)'s autonomous loop runs only on Claude Code or Codex, with one model for both roles; its legacy client has the wide registry. [HexStrike AI](/p/hexstrike-ai/) makes no LLM calls, so the MCP client chooses the model.

Pick: Decepticon or RAPTOR to mix strong and cheap models by role under a cap.
Pick: Strix for a single hard spend limit on unattended runs.
Pick: Nebula, PentAGI or RedAmon for local and self-hosted model endpoints.

## Per-project answers

### usestrix/strix (answered)

Strix supports **any LLM provider** through the LiteLLM routing layer integrated into the OpenAI Agents SDK's `MultiProvider` pattern, with the custom `StrixProvider` (`config/models.py:563–667`).

**Model configuration** — The primary model is set via `STRIX_LLM` env var (e.g. `vercel_ai_gateway/zai/glm-5.3`, `openrouter/deepseek/deepseek-v4.1-flash-1017`, `anthropic/claude-opus-5-5`) or `llm.model` in settings (`config/settings.py:32`). The `StrixProvider` resolves prefixed model names via LiteLLM: non-OpenAI/Anthropic prefixes route through LiteLLM with the prefix preserved. The provider also supports a **ChatGPT subscription backend** through `codex.subscription_model()` which returns a `_CodexResponsesModel` using the ChatGPT API.

**Per-role model selection** — A separate deduplication model can be configured via `STRIX_DEDUPE_MODEL` with its own API key, base URL, reasoning effort, extra headers, and extra body (`config/settings.py:116–140`). This keeps the judge model separate from the pentester model for cost and capability reasons. The dedupe model is resolved via `resolve_dedupe_model()` (models.py:53–65), binding to its own endpoint when configured.

**Cost management** — `max_budget_usd` enforces a dollar-based budget with multi-band warnings (70%/85%/95% thresholds in `hooks.py:57–60`). A 90% subagent reserve ensures the root agent can finish writing. Two budget policies: `stop` (hard stop at limit) and `pause` (park agents, wait for operator to extend). The budget is shared across all agents. Cost is tracked via LiteLLM's `success_callback` which records provider-reported cost, OpenRouter's per-stream cost capture, and a fallback cost-map estimate (`report/state.py:1089–1221`). Manual pricing overrides per model are available via `STRIX_LLM_INPUT_COST_PER_MTOK`, `STRIX_LLM_OUTPUT_COST_PER_MTOK`, and `STRIX_LLM_CACHED_INPUT_COST_PER_MTOK` (`settings.py:66–71`).

**Context window management** — Auto-compaction (`STRIX_CONTEXT_AUTO_COMPACT`, defaults on) summarizes old turns when the model's context window is near capacity (`llm/compaction.py`). Configurable via `compact_buffer_tokens` (20K), `keep_tokens` (8K), `fallback_context_tokens` (200K for unmapped models), and `summary_max_tokens` (4K). The context window is read from LiteLLM's model metadata via `context_budget.py:context_window()`.

**Local models** — Supported via `LLM_API_BASE` pointing at a local endpoint (Ollama, LM Studio, vLLM). The `StrixProvider` routes unprefixed or non-OpenAI names through LiteLLM which handles the HTTP translation. Streaming can be disabled via `LLM_DISABLE_STREAMING` for gateways that don't support SSE.

**Per-turn guardrails** — The `_TurnGuardModel` (`models.py:262–387`) rewrites tool-call IDs per turn (preventing provider rejection from reused IDs), limits tool calls per response, and enforces stream idle/first-event/total timeouts. Transient errors are retried up to 5 times with exponential backoff up to 90s.


Citations: [strix/config/models.py:563-667](https://github.com/usestrix/strix/blob/6b7ae2ebe4d47037a927aade23265ff4e4f27e84/strix/config/models.py#L563-L667) · [strix/config/settings.py:29-113](https://github.com/usestrix/strix/blob/6b7ae2ebe4d47037a927aade23265ff4e4f27e84/strix/config/settings.py#L29-L113) · [strix/report/dedupe.py:33-65](https://github.com/usestrix/strix/blob/6b7ae2ebe4d47037a927aade23265ff4e4f27e84/strix/report/dedupe.py#L33-L65) · [strix/core/hooks.py:165-250](https://github.com/usestrix/strix/blob/6b7ae2ebe4d47037a927aade23265ff4e4f27e84/strix/core/hooks.py#L165-L250) · [strix/llm/compaction.py:340-370](https://github.com/usestrix/strix/blob/6b7ae2ebe4d47037a927aade23265ff4e4f27e84/strix/llm/compaction.py#L340-L370)

### KeygraphHQ/shannon (answered)

**One model runs the entire workflow**, set via `SHANNON_AI_MODEL=<provider>:<model-id>`, defaulting to `anthropic:claude-sonnet-4-6` (`apps/worker/src/ai/models.ts:84`). There is no per-role or per-phase model selection — every agent (pre-recon, recon, 5 vuln agents, 5+1 exploit agents, report agent) and the Capella SAST child workflow use the same model.

**Supported Providers**: Four curated providers with dedicated credential variables — `anthropic` (`ANTHROPIC_API_KEY`), `openai` (`OPENAI_API_KEY`), `xai` (`XAI_API_KEY`), `amazon-bedrock` (`AWS_BEARER_TOKEN_BEDROCK` + `AWS_REGION`). Any other pi-ai provider ID works via the generic `SHANNON_AI_API_KEY` env var. Bedrock is the only exception — it authenticates through AWS_ variables, not the generic key (`apps/worker/src/ai/models.ts:54-81`).

**Model Resolution**: Resolution happens at scan start via `resolveModelSelection()` (`apps/worker/src/ai/models.ts:285-313`), which parses the spec (splitting on the **first** colon only to preserve Bedrock IDs), collects credentials from env vars, creates a `ModelRuntime` via pi with network catalogue refresh (10s timeout, falls back to static), and looks up the model. A `--models-config` file overlays custom model definitions onto pi's catalogue via `models.json`. Custom definitions and the generic `SHANNON_AI_BASE_URL` for endpoint overrides are both supported. Credentials stay in an in-memory `RuntimeCredentialStore` — never written to disk (`apps/worker/src/ai/models.ts:163-195`). Pi auth.json reuse is supported via `SHANNON_USE_PI_AUTH=1`.

**Thinking Level**: Set to `'high'` globally (`apps/worker/src/ai/pi/thinking-level.ts`), passed to every `createAgentSession` call for deeper analysis than pi's default (`medium`). The preflight credential probe and structured generation calls run without reasoning.

**Cost and Context Management**: pi's **context compaction** is enabled (`compaction: { enabled: true }`, `apps/worker/src/ai/pi/pi-executor.ts:344`) to guard against context window overflow on long agent runs. Usage (tokens, cost, cache hits) is tracked per agent and aggregated into `OperationalMetrics` for the final summary (`apps/worker/src/temporal/workflows.ts:313-325`). The `task` child-session tool accumulates its own usage and reports it back to the parent for accurate total spend (`apps/worker/src/ai/pi/task-tool.ts:183-191`). There is no user-configurable token or cost budget — the only cost control is Temporal's activity retry and the pipeline's stop conditions. pi's retry settings absorb provider-level transport faults (`apps/worker/src/ai/pi/retry-settings.ts`).


Citations: [apps/worker/src/ai/models.ts:54-84](https://github.com/KeygraphHQ/shannon/blob/b9744f6cecc5429333873b86a6762f1d70c54fc2/apps/worker/src/ai/models.ts#L54-L84) · [apps/worker/src/ai/models.ts:99-123](https://github.com/KeygraphHQ/shannon/blob/b9744f6cecc5429333873b86a6762f1d70c54fc2/apps/worker/src/ai/models.ts#L99-L123) · [apps/worker/src/ai/models.ts:137-154](https://github.com/KeygraphHQ/shannon/blob/b9744f6cecc5429333873b86a6762f1d70c54fc2/apps/worker/src/ai/models.ts#L137-L154) · [apps/worker/src/ai/models.ts:238-313](https://github.com/KeygraphHQ/shannon/blob/b9744f6cecc5429333873b86a6762f1d70c54fc2/apps/worker/src/ai/models.ts#L238-L313) · [apps/worker/src/ai/pi/pi-executor.ts:332-346](https://github.com/KeygraphHQ/shannon/blob/b9744f6cecc5429333873b86a6762f1d70c54fc2/apps/worker/src/ai/pi/pi-executor.ts#L332-L346) · [apps/worker/src/ai/pi/task-tool.ts:183-191](https://github.com/KeygraphHQ/shannon/blob/b9744f6cecc5429333873b86a6762f1d70c54fc2/apps/worker/src/ai/pi/task-tool.ts#L183-L191)

### vxcontrol/pentagi (answered)

PentAGI supports 13 provider types, all documented in the `AllProviderTypes` constant (`pkg/providers/provider/provider.go:68-82`): OpenAI, Anthropic, Gemini, Bedrock (AWS), Ollama, Custom (OpenAI-compatible), DeepSeek, GLM, Kimi, Qwen, MiniMax, Mistral, and xAI.

**Provider architecture.** Each provider has a registry entry in `pkg/providers/registry.go:48-165` with a type, default name, `Enabled` gate (checks for API key env vars), `NewConfig` (creates default pconfig), `New` (constructor), and `BuildConfig` (from persisted data). OpenAI-compatible providers (DeepSeek, GLM, Kimi, Qwen, MiniMax, Mistral, xAI, Custom) use the shared `openaicompat` door module (`pkg/providers/openaicompat/`). Custom endpoints with `LLM_SERVER_URL` + `LLM_SERVER_KEY` allow connecting to any OpenAI-compatible backend. Federated (token-based) auth is supported for Anthropic (`pkg/providers/routing.go:54-63`).

**Per-role model configuration.** The `pconfig` package (`pkg/providers/pconfig/config.go`) provides per-agent-role model selection. `flowProvider.Model(optAgentType)` returns the model for a given role (primary_agent, pentester, coder, etc.). Each provider's `models.yml` ships predefined model-to-capability mappings (e.g., gpt-4 for primary agent, gpt-3.5-turbo for cheaper roles). The catalog system (`bundledCatalogs` in `pkg/providers/catalog.go`) lets operators see which shipped models are actually served by the configured endpoint.

**Local models.** Ollama fully supports local models via `OLLAMA_SERVER_URL` (`pkg/config/config.go`). Bedrock also supports locally hosted models via a custom server URL, and Custom endpoints work with any OpenAI-compatible local server (vLLM, LocalAI, etc.).

**Cost and context management.** Token usage (input, output, cache reads/writes) is tracked per `Msgchain` row (`pkg/database/models.go:979-997`) with cost fields (`UsageCostIn`, `UsageCostOut`). Chain summarization (`compactChainForWindow` in `pkg/providers/performer.go:139-148`) compacts conversation history when it exceeds context windows. The `pkg/csum/` package handles chain summarization for LLM context management. `pkg/providers/provider/limits.go` likely holds per-model context window limits. Streaming supports real-time token output to the UI via subscription callbacks (`streamCb` in performer.go:516-548). There is no hard token budget per run; instead, iteration caps (100 for general agents, 20 for limited agents) bound total cost.


Citations: [backend/pkg/providers/provider/provider.go:50-83](https://github.com/vxcontrol/pentagi/blob/cffed9485aa1cca70762cd08a57ac62a80406258/backend/pkg/providers/provider/provider.go#L50-L83) · [backend/pkg/providers/registry.go:48-165](https://github.com/vxcontrol/pentagi/blob/cffed9485aa1cca70762cd08a57ac62a80406258/backend/pkg/providers/registry.go#L48-L165) · [backend/pkg/providers/performer.go:96-114](https://github.com/vxcontrol/pentagi/blob/cffed9485aa1cca70762cd08a57ac62a80406258/backend/pkg/providers/performer.go#L96-L114) · [backend/pkg/providers/performer.go:138-149](https://github.com/vxcontrol/pentagi/blob/cffed9485aa1cca70762cd08a57ac62a80406258/backend/pkg/providers/performer.go#L138-L149) · [backend/pkg/providers/routing.go:36-50](https://github.com/vxcontrol/pentagi/blob/cffed9485aa1cca70762cd08a57ac62a80406258/backend/pkg/providers/routing.go#L36-L50)

### GreyDGL/PentestGPT (answered)

The autonomous framework (`pentestgpt_agent/`) supports exactly **two backends**: `claude` and `codex` (`trial.py:119`). Both use the external `unified-agent` package which provides normalized task invocation, structured-output, and event streaming. The agent model name is passed as a CLI string (`--model`) with no registry validation — it is forwarded to the backend SDK directly. Both roles share the same model. Supported reasoning efforts include `low|medium|high|xhigh` for both backends, plus `max` for Claude and `none|minimal` for Codex (`trial.py:123-130`). The Supervisor gets a max of 4 provider turns, the Executor gets 12 by default (both configurable up to 100). Each Executor turn budget varies by task kind (`agents.py:209-216`). Provider costs and token usage are aggregated from episode traces into the trial summary (`trial.py:206-275`) as `cost_usd` and usage breakdown (input, cached-input, output, reasoning-output tokens). There are no per-role model selection or local-model hooks in the autonomous framework; the Claude auto-memory and nonessential traffic features are explicitly disabled via environment variables (`trial.py:58-65`).

The **legacy client** (`pentestgpt_legacy/`) supports a much wider model range through its own provider clients. The registry (`llm/registry.py`) lists models from OpenAI (GPT-5.5, GPT-5.4, o3, o4-mini), Anthropic (Claude Opus 4.8, Sonnet 4.6, Haiku 4.5), Google Gemini (3.1 Pro, 3.5 Flash, 3 Pro), DeepSeek (v4 Flash, v4 Pro), xAI Grok (4.3), Alibaba Qwen (3.7 Max, 3.5 Flash), Moonshot Kimi (K2.6), plus dynamic `ollama:<model>` for local models. It uses three separate LLMClient roles (reasoning, generation, parsing) with different models per role, auto-detecting defaults from configured providers (`config.py:40-44`). Context windows range from 128K to 1M tokens. All OpenAI-compatible providers share the same `OpenAICompatibleProvider` class via per-provider base URLs.


Citations: [pentestgpt_agent/src/pentestgpt_agent/trial.py:107-130](https://github.com/GreyDGL/PentestGPT/blob/e8b1bb77d1ac00329675cec3b060aba971ec1ac8/pentestgpt_agent/src/pentestgpt_agent/trial.py#L107-L130) · [pentestgpt_agent/src/pentestgpt_agent/trial.py:58-65](https://github.com/GreyDGL/PentestGPT/blob/e8b1bb77d1ac00329675cec3b060aba971ec1ac8/pentestgpt_agent/src/pentestgpt_agent/trial.py#L58-L65) · [pentestgpt_agent/src/pentestgpt_agent/agents.py:209-216](https://github.com/GreyDGL/PentestGPT/blob/e8b1bb77d1ac00329675cec3b060aba971ec1ac8/pentestgpt_agent/src/pentestgpt_agent/agents.py#L209-L216) · [pentestgpt_legacy/llm/registry.py:59-269](https://github.com/GreyDGL/PentestGPT/blob/e8b1bb77d1ac00329675cec3b060aba971ec1ac8/pentestgpt_legacy/llm/registry.py#L59-L269) · [pentestgpt_legacy/llm/config.py:29-76](https://github.com/GreyDGL/PentestGPT/blob/e8b1bb77d1ac00329675cec3b060aba971ec1ac8/pentestgpt_legacy/llm/config.py#L29-L76)

### 0x4m4/hexstrike-ai (answered)

**The repository has no LLM model configuration, no provider selection logic, and no cost or context-window management.** The project is not an AI agent — it is a tool server that exposes security tools via the Model Context Protocol (MCP). The MCP client configuration (`hexstrike-ai-mcp.json`) shows a `"command": "python3"` stdio transport that an external AI client (Claude Desktop, VS Code Copilot, Cursor) connects to. The `FastMCP` import from `mcp.server.fastmcp` (line 29 of `hexstrike_mcp.py`) provides the MCP transport layer, but the server itself makes no LLM API calls. The README lists "Claude, GPT, or other MCP-compatible agents" as supported, but the code has no model selection, no per-role model routing, no token counting, and no budget enforcement. The external AI client (e.g., the user's Claude Desktop configuration) decides which model to use entirely outside this project. There is no support for local models (Ollama, llama.cpp, etc.), no API key configuration for any LLM provider, and no context-window management logic. The `5000` line count of tool definitions is determined by the number of MCP tool functions registered, not by context limits. The project documentation suggests setting `"timeout": 300` in the MCP config, but that's an HTTP timeout for the tool execution, not an LLM parameter.


Citations: [hexstrike-ai-mcp.json:1-14](https://github.com/0x4m4/hexstrike-ai/blob/d689933ff579d839c676c82b231f8e98326c5f04/hexstrike-ai-mcp.json#L1-L14) · [hexstrike_mcp.py:267-310](https://github.com/0x4m4/hexstrike-ai/blob/d689933ff579d839c676c82b231f8e98326c5f04/hexstrike_mcp.py#L267-L310) · [hexstrike_mcp.py:29-29](https://github.com/0x4m4/hexstrike-ai/blob/d689933ff579d839c676c82b231f8e98326c5f04/hexstrike_mcp.py#L29-L29) · [hexstrike_server.py:1544-1545](https://github.com/0x4m4/hexstrike-ai/blob/d689933ff579d839c676c82b231f8e98326c5f04/hexstrike_server.py#L1544-L1545) · [README.md:630-648](https://github.com/0x4m4/hexstrike-ai/blob/d689933ff579d839c676c82b231f8e98326c5f04/README.md#L630-L648)

### BitterSecurity/Decepticon (answered)

**Multi-provider via LiteLLM proxy.** All LLM calls route through a LiteLLM Docker proxy for provider abstraction (`llm/factory.py`, lines 1–20). The `LLMFactory` binds role-specific `ChatOpenAI` instances pointing to the proxy. Supported AuthMethods include: `ANTHROPIC_OAUTH`, `ANTHROPIC_API`, `OPENAI_OAUTH`, `OPENAI_API`, `COPILOT_OAUTH`, `GOOGLE_OAUTH`, `GOOGLE_API`, `DEEPSEEK_API`, `XAI_API`, `MISTRAL_API`, `OPENROUTER_API`, `NVIDIA_API`, `GROQ_API`, `TOGETHER_API`, `FIREWORKS_API`, `COHERE_API`, `MOONSHOT_API`, `KIMI_API`, `ZAI_API`, `MINIMAX_API`, plus community gateways (Vercel, HuggingFace, Venice, ZenMux, Cloudflare, Qianfan, cheaper_inference) and OLLAMA/LM Studio for local models (`llm/model_contracts.py`, lines 43–51).

**Per-role tier-based model selection.** Each agent role is assigned a `Tier` (HIGH/MID/LOW) in `AGENT_TIERS` (`decepticon_core/types/llm.py`, lines 541–574). Example assignments: decepticon, exploit, analyst = HIGH; recon, soundwave = LOW; verifier, postexploit = MID. Three profiles control tier resolution: `eco` (per-role tiers), `max` (all HIGH), `test` (all LOW). Each AuthMethod defines a model per tier — e.g., HIGH for Anthropic = `claude-opus-4-8`, MID = `claude-sonnet-4-6`, LOW = `claude-haiku-4-5`. Per-role `temperatures` (`AGENT_TEMPERATURES`, lines 576–604) range from 0.1 (ICS operator) to 0.4 (decepticon, phisher).

**Cost and budget controls.** `BudgetEnforcementMiddleware` (`middleware/budget.py`, lines 1–56) enforces per-engagement and per-agent USD spend caps via the LiteLLM proxy's `/spend/tags` API. It tags every completion with `engagement:<slug>` and `agent:<slug>:<agent>` metadata. At the configured soft-warn threshold (default 70% of cap) it emits a stream event; at 100% it raises `BudgetExceeded` and terminates the run. Custom output token caps are configured per model route (64K for Claude Sonnet/Haiku 4.5, 128K for newer Claude models and GPT models) in `_model_max_output_tokens()` (`llm/factory.py`, lines 133–155).

**Context-window management.** `AnthropicPromptCachingMiddleware` (`middleware_slots.py`, line 450) caches system prompts for Anthropic models. `SummarizationMiddleware` (line 445) auto-compacts when the context budget is exceeded. The `_SafeSummarizationProxy` (lines 267–443) binds summarization to the per-request model and handles provider failures gracefully. The `ModelFallbackMiddleware` (lines 251–264) chains primary→fallback models on provider failure.


Citations: [packages/decepticon-core/decepticon_core/types/llm.py:541-605](https://github.com/BitterSecurity/Decepticon/blob/cd252a5467b91ccfdb46fde9562c75d671d33604/packages/decepticon-core/decepticon_core/types/llm.py#L541-L605) · [packages/decepticon/decepticon/llm/factory.py:1-20](https://github.com/BitterSecurity/Decepticon/blob/cd252a5467b91ccfdb46fde9562c75d671d33604/packages/decepticon/decepticon/llm/factory.py#L1-L20) · [packages/decepticon/decepticon/llm/factory.py:133-181](https://github.com/BitterSecurity/Decepticon/blob/cd252a5467b91ccfdb46fde9562c75d671d33604/packages/decepticon/decepticon/llm/factory.py#L133-L181) · [packages/decepticon/decepticon/agents/middleware_slots.py:445-454](https://github.com/BitterSecurity/Decepticon/blob/cd252a5467b91ccfdb46fde9562c75d671d33604/packages/decepticon/decepticon/agents/middleware_slots.py#L445-L454) · [packages/decepticon/decepticon/middleware/budget.py:1-56](https://github.com/BitterSecurity/Decepticon/blob/cd252a5467b91ccfdb46fde9562c75d671d33604/packages/decepticon/decepticon/middleware/budget.py#L1-L56)

### gadievron/raptor (answered)

RAPTOR supports five LLM provider families via native SDKs: **Anthropic** (Claude models via `anthropic` SDK), **OpenAI** (GPT models via `openai` SDK), **Google Gemini** (via `google-genai` SDK with OpenAI shim fallback), **Mistral** (via `mistralai` SDK), and **Ollama** (local models via OpenAI-compatible endpoint). Provider defaults are defined in `core/llm/model_data.py`: Anthropic defaults to `claude-opus-4-6`, OpenAI to `gpt-5.4`, Gemini to `gemini-2.5-pro`, Mistral to `mistral-large-latest`. Fast/cheap model mappings exist per provider (e.g., `claude-haiku-4-5`, `gpt-4o-mini`, `gemini-2.5-flash-lite`) for lightweight classification tasks. Per-role model selection is configured via `models.json` (at `~/.config/raptor/models.json`) which maps provider, model name, optional role, and API key. The configuration system (`core/llm/config.py`) reads this file, detects SDK availability, and auto-discovers Ollama models. The **client** (`core/llm/client.py`) provides automatic fallback across providers, retry logic with exponential backoff, cost tracking with per-call budget reservation (`_BUDGET_RESERVATION=0.10`), response caching, and task-specific model selection. The **multi-model** subsystem (`core/llm/multi_model/`) runs N models against the same task with dispatch, merge, review, and optional LLM aggregation — used by `/agentic`'s consensus mode. Cost management includes a `core/llm/cost.py` sanitisation layer (sanitizes NaN/inf negative floats to 0.0), per-call cost estimates from scorecard history (`core/llm/client.py` defines a `_DEFAULT_CALL_COST_ESTIMATE=2.00`), and budget caps per client. Context window management (`core/llm/context_window.py`) defines line-window limits for per-finding classifier context (default: 50 lines before/after a finding, 5 lines per dataflow step). The `core/llm/prompt_budget.py` module provides `fit_to_budget()` for priority-based prompt section shedding when approaching budget limits. The `core/llm/concurrency.py` module caps LLM parallelism at 32 workers with provider-specific RPM awareness.


Citations: [core/llm/model_data.py:100-200](https://github.com/gadievron/raptor/blob/265236fc9f328be7df46cee36969fd447463c3c6/core/llm/model_data.py#L100-L200) · [core/llm/client.py:80-160](https://github.com/gadievron/raptor/blob/265236fc9f328be7df46cee36969fd447463c3c6/core/llm/client.py#L80-L160) · [core/llm/config.py:1-60](https://github.com/gadievron/raptor/blob/265236fc9f328be7df46cee36969fd447463c3c6/core/llm/config.py#L1-L60) · [core/llm/multi_model/__init__.py:1-58](https://github.com/gadievron/raptor/blob/265236fc9f328be7df46cee36969fd447463c3c6/core/llm/multi_model/__init__.py#L1-L58) · [core/llm/context_window.py:1-80](https://github.com/gadievron/raptor/blob/265236fc9f328be7df46cee36969fd447463c3c6/core/llm/context_window.py#L1-L80) · [core/llm/prompt_budget.py:1-60](https://github.com/gadievron/raptor/blob/265236fc9f328be7df46cee36969fd447463c3c6/core/llm/prompt_budget.py#L1-L60)

### CyberStrikeus/CyberStrike (answered)

**150+ AI providers, 5,300+ models supported.** The provider system (`provider/provider.ts`) is a plugin-based architecture. Bundled providers include Anthropic, OpenAI, GitHub Copilot, Google Vertex, Amazon Bedrock, OpenRouter, Azure, GitLab, Cloudflare Workers AI, SAP AI Core, and 23+ bundled SDK providers. An additional 150+ providers are loaded from the models.dev catalog. The configuration can enable/disable providers via `enabled_providers`/`disabled_providers`, and blacklist/whitelist models per provider.

**Model definition** (`Provider.Model`, lines 597-675) includes cost per token (input/output/cache), context/output limits, capabilities (temperature, reasoning, attachment, toolcall, modalities), status (alpha/beta/active/deprecated), and variants for mode-specific overrides (e.g., different providers for structured output vs chat).

**Per-role model selection.** Each agent can specify a `model` override or `useSmallModel: true` (resolved via `Provider.getSmallModel()` to a cheaper tier like Claude Haiku or GPT-5-nano). During the loop, `useSmallModel` downgrades the model at runtime without changing the persisted user message. Step caps prevent runaway costs.

**Context-window management.** Each model defines `limit.context` (max context tokens) and `limit.output`. The compaction system (`SessionCompaction.isOverflow`) triggers at context-limit minus reserved tokens (20K default). The error module (`provider/error.ts`) detects context-overflow errors from various providers (OpenAI, OpenRouter, DeepSeek, MiniMax, xAI) to handle gracefully.

**Cost tracking** is built into every model definition with per-tier costs for input, output, and cache (read/write). The system tracks token usage per message/part. The `getSmallModel()` heuristic prefers `claude-haiku-4-5`, `gemini-3-flash`, `gpt-5-nano` based on provider availability.

**Local model support** is supported through OpenAI-compatible endpoints (vLLM, Ollama, etc.) configured via the config file with custom `api` URL. Authentication supports API key, OAuth, and Bearer token methods. The `cyberstrike` public provider offers free models (nano tier) as fallback.


Citations: [packages/cyberstrike/src/provider/provider.ts:1-200](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/provider/provider.ts#L1-L200) · [packages/cyberstrike/src/provider/provider.ts:597-700](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/provider/provider.ts#L597-L700) · [packages/cyberstrike/src/session/compaction.ts:30-50](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/session/compaction.ts#L30-L50) · [packages/cyberstrike/src/agent/agent.ts:120-160](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/agent/agent.ts#L120-L160)

### samugit83/redamon (answered)

**12 provider types** are supported, resolved via model-id prefix (`llm_setup.py:90-136`): `custom/<id>` (user-configured), `openrouter/<model>`, `bedrock/<model>`, `deepseek/<model>`, `gemini/<model>`, `glm/<model>`, `kimi/<model>`, `qwen/<model>`, `xai/<model>`, `mistral/<model>`, `claude-*` (Anthropic), and anything else (OpenAI). Each maps to a LangChain wrapper: `ChatOpenAI`, `ChatAnthropic`, or `ChatBedrockConverse` (`llm_setup.py:139-300`).

**Per-role model selection.** The agent is a single-model system — the main `think_node` LLM is built by `setup_llm()` using the project's `OPENAI_MODEL` setting and user's Global Settings API keys. Separate models can be assigned to sub-features: the **Tradecraft section picker** uses `feature_model()` to resolve its own model from `USER_SETTINGS` (`orchestrator.py:341-353`), the **guardrail** uses whatever main LLM is configured, and the **report summarizer** uses the main model. There are no per-role models in a crew sense — only one agent drives all decisions.

**Local model support** via the `custom/<id>` provider type. The `CUSTOM_PROVIDER_TYPES` enum (`llm_builder.py:42`) includes `openai_compatible`, `bedrock_custom`, and `ollama_local`. OpenAI-compatible custom providers support `streaming=True`, `reasoning_effort`, configurable `base_url`, `sslVerify` toggle, custom headers, and timeout (`llm_setup.py:224-263`). The default API key is `"ollama"` (the key Ollama expects).

**Cost and context management.** The state tracks `input_tokens_used`/`output_tokens_used`/`tokens_used` cumulatively across the session (`state.py:1123-1129`). Per-turn deltas (`_input_tokens_this_turn`, `_output_tokens_this_turn`) are emitted for UI rendering. Anthropic prompt caching is supported (`ANTHROPIC_PROMPT_CACHING_ENABLED`, `project_settings.py:80` — marks static system prompt prefixes with `cache_control={"type": "ephemeral"}`). There are no hard token budgets — the system relies on MAX_ITERATIONS (default 100), tool deadlines, and execution trace truncation (default 100 steps). The LATS tree is bounded by `LATS_MAX_ROLLOUTS` (24) and `LATS_MAX_TREE_NODES` (60). Provider keys rotate via `KeyRotator` (`orchestrator.py:215-219`) for rotating API keys on a per-N-calls basis.

**Model discovery** is available via the `/models` API endpoint using `model_providers.py`, which fetches available model lists from each configured provider (OpenAI, Anthropic, OpenRouter, Bedrock). The `fetch_user_providers()` function (`llm_builder.py:71-95`) retrieves the user's LLM provider configurations from the webapp API.

> **Editor's note.** Correction: LATS defaults are LATS_MAX_ROLLOUTS 50 and LATS_MAX_TREE_NODES 120 (agentic/project_settings.py L119-L120), and LATS is disabled by default (LATS_ENABLED False).

Citations: [agentic/orchestrator_helpers/llm_setup.py:90-300](https://github.com/samugit83/redamon/blob/b13da9cb5ad35ae75428b8f21794e799a25fd201/agentic/orchestrator_helpers/llm_setup.py#L90-L300) · [agentic/llm_builder.py:31-200](https://github.com/samugit83/redamon/blob/b13da9cb5ad35ae75428b8f21794e799a25fd201/agentic/llm_builder.py#L31-L200) · [agentic/project_settings.py:69-80](https://github.com/samugit83/redamon/blob/b13da9cb5ad35ae75428b8f21794e799a25fd201/agentic/project_settings.py#L69-L80) · [agentic/state.py:1123-1136](https://github.com/samugit83/redamon/blob/b13da9cb5ad35ae75428b8f21794e799a25fd201/agentic/state.py#L1123-L1136) · [agentic/orchestrator_helpers/model_providers.py:1-72](https://github.com/samugit83/redamon/blob/b13da9cb5ad35ae75428b8f21794e799a25fd201/agentic/orchestrator_helpers/model_providers.py#L1-L72) · [agentic/orchestrator.py:215-219](https://github.com/samugit83/redamon/blob/b13da9cb5ad35ae75428b8f21794e799a25fd201/agentic/orchestrator.py#L215-L219)

### GH05TCREW/pentestagent (answered)

**Provider-agnostic via LiteLLM.** The `LLM` class (`llm/llm.py:29`) wraps `litellm.acompletion` and supports **any provider** LiteLLM does, including Anthropic, OpenAI, Google Gemini, Groq, Ollama, and custom endpoints. The model is set via the `PENTESTAGENT_MODEL` environment variable (`config/constants.py:60-62`) or the `--model` CLI flag. `get_available_models()` (`llm/llm.py:417`) lists common options including `gpt-5`, `claude-sonnet-4-20250514`, `gemini-2.5-pro`, `ollama/llama3`, and `groq/llama3-70b-8192`.

**No per-role model selection.** Both the single agent and crew orchestrator use the same `LLM` instance with the same model. Worker agents in crew mode also share the orchestrator's LLM instance (`crew/worker_pool.py:114: PentestAgentAgent(llm=self.llm, ...)`). The `spawn_mcp_agent` tool (`tools/mcp_agent.py:137`) accepts a per-child `model` override. There is no router or model-specific assignment per role/phase.

**Configuration.** `ModelConfig` (`llm/config.py:10`) provides: temperature (default 0.7), max_tokens (4096), top_p (1.0), frequency/presence penalties, max_context_tokens (128000), retry settings (max_retries=5, exponential backoff), and `openai_api_base` for routing through custom OpenAI-compatible endpoints. Three presets exist: `CREATIVE_CONFIG` (0.9 temp), `PRECISE_CONFIG` (0.1 temp), `BALANCED_CONFIG` (0.7 temp).

**Context-window management.** `ConversationMemory` (`llm/memory.py:31`) manages the 128K token budget. It reserves 80% for message history (leaving 20% for the response), triggers LLM-based summarization when history exceeds 60% of budget, keeps the 10 most recent messages in full, and truncates from the front if still over budget. `get_messages_with_summary()` (`llm/memory.py:118`) is the main entry point: it splits history at the summarize threshold, passes older messages to the LLM for chunked summarization, and prepends the cached summary as a system message on subsequent turns.

**Token/cost tracking.** Usage is recorded per-response via `response.usage` (`llm/llm.py:241-253`) and forwarded to a persistent `token_tracker` (best-effort, `llm.py:256-269`). In the orchestrator loop, token usage per phase is yielded as progress events (`orchestrator.py:183-184`). The worker pool tracks per-worker token consumption and exposes `finish_tokens` for synthesis costs. There is no explicit cost budget or cap beyond the iteration limit.

**Ollama support.** When `OLLAMA_BASE_URL` or `OLLAMA_URL` is set in the environment, the LLM init populates several environment variable names (`OLLAMA_HOST`, `LITELLM_OLLAMA_BASE_URL`, etc.) to support varying LiteLLM/Ollama client conventions (`llm/llm.py:57-68`). Models are referenced with the `ollama/` prefix (e.g., `ollama/llama3`).


Citations: [pentestagent/llm/llm.py:29-88](https://github.com/GH05TCREW/pentestagent/blob/8dde193e41d34ac53ee87374316e5d2fe7cec946/pentestagent/llm/llm.py#L29-L88) · [pentestagent/llm/llm.py:417-440](https://github.com/GH05TCREW/pentestagent/blob/8dde193e41d34ac53ee87374316e5d2fe7cec946/pentestagent/llm/llm.py#L417-L440) · [pentestagent/llm/config.py:10-49](https://github.com/GH05TCREW/pentestagent/blob/8dde193e41d34ac53ee87374316e5d2fe7cec946/pentestagent/llm/config.py#L10-L49) · [pentestagent/llm/memory.py:31-80](https://github.com/GH05TCREW/pentestagent/blob/8dde193e41d34ac53ee87374316e5d2fe7cec946/pentestagent/llm/memory.py#L31-L80) · [pentestagent/llm/memory.py:118-175](https://github.com/GH05TCREW/pentestagent/blob/8dde193e41d34ac53ee87374316e5d2fe7cec946/pentestagent/llm/memory.py#L118-L175) · [pentestagent/config/constants.py:60-70](https://github.com/GH05TCREW/pentestagent/blob/8dde193e41d34ac53ee87374316e5d2fe7cec946/pentestagent/config/constants.py#L60-L70)

### Armur-Ai/Pentest-Swarm-AI (answered)

**Supported providers** (from `internal/llm/factory.go:100-288`): claude (Anthropic), together (Together AI), openai (native or any OpenAI-compatible), gemini (Google), ollama (local), lmstudio (local), orcarouter (OrcaRouter gateway), openrouter (OpenRouter gateway), bedrock (AWS Bedrock), musespark (Meta Muse Spark). All implement the `Provider` interface (`provider.go:11-29`) with `Complete`, `Stream`, `HealthCheck`, `ModelName`, `ContextWindow`, `SupportsToolUse`.

**Per-role model selection**: By default, all agents inherit the orchestrator's provider and key (`config.example.yaml:102-122`). In swarm mode, per-role routing is applied: on Together AI, all roles get `zai-org/GLM-5.3-Flash` (`swarm_runner.go:55-57`); on OpenRouter, bulk roles (recon, report) get `deepseek/deepseek-v4.1-flash` and reasoning roles (classifier, exploit) get `z-ai/glm-5.3-flash` (`swarm_runner.go:68-75`). An explicit `--model` or per-agent config override wins over defaults (`swarm_runner.go:187-193`).

**Local model support**: Ollama and LM Studio providers use local endpoints (`factory.go:117-135`). The config example shows how to point individual agents at fine-tuned local models (`config.example.yaml:107-122` e.g. `ArmurAI/recon-agent-qwen2.5-7b`). Context window minimum is validated at 32k tokens (`factory.go:296-298`).

**Cost context management**: The `llm.Meter` (`swarm_runner.go:167`) wraps every provider and aggregates token spend against a pricing table (`pricing.go:25-103`) covering 20+ model SKUs across all vendors. A live cost-meter goroutine (`swarm_runner.go:245-269`) polls every 3s, emits spend to the event stream every 15s, and winds the campaign down when `MaxCostUSD` is exceeded. The `BudgetManager` (`llm/budget.go:8-99`) tracks context-window utilization, warns at 80%, and can summarize oldest messages at 70% threshold by asking the LLM to compress them. Per-agent token budgets (`board.go:47-53`) prevent one chatty agent from burning the campaign's headroom; the scheduler checks `AgentBudget` before dispatch (`scheduler.go:335-352`).

**Refusal retry**: `NewProviderWithRetry` (`prompts/factory.go:23-48`) wraps the primary provider with a configurable fallback provider. If a safety filter refuses a legitimate offense-security prompt, a stricter reframe is attempted, then a fallback to a less-restrictive provider.

> **Editor's note.** Correction: `BudgetManager` (summarise at 70%) is only used in internal/agent/orchestrator, a package nothing imports; the live engines send bounded single-shot prompts per agent call, so no context summarisation runs.

Citations: [internal/llm/pricing.go:17-103](https://github.com/Armur-Ai/Pentest-Swarm-AI/blob/40985e3184a5622fa76dc0b491ccb51b48d7acdf/internal/llm/pricing.go#L17-L103) · [internal/engine/swarm_runner.go:40-97](https://github.com/Armur-Ai/Pentest-Swarm-AI/blob/40985e3184a5622fa76dc0b491ccb51b48d7acdf/internal/engine/swarm_runner.go#L40-L97) · [internal/engine/swarm_runner.go:148-170](https://github.com/Armur-Ai/Pentest-Swarm-AI/blob/40985e3184a5622fa76dc0b491ccb51b48d7acdf/internal/engine/swarm_runner.go#L148-L170)

### berylliumsec/nebula (answered)

Nebula supports **17 provider flavors** through a provider-abstracted gateway (`providers.py:198-223`): `OPENAI`, `ANTHROPIC`, `GEMINI`, `VERTEX`, `BEDROCK`, `AZURE_OPENAI`, `MISTRAL`, `COHERE`, `XAI`, `DEEPSEEK`, `GROQ`, `TOGETHER`, `FIREWORKS`, `OPENROUTER`, `OLLAMA`, `VLLM`, `LLAMA_CPP`, `SGLANG`, `LM_STUDIO`, `HUGGINGFACE_ENDPOINT`, `NVIDIA_NIM`, and `CUSTOM`.

**Model configuration** (`providers.py:256-363`): Each `ProviderConfig` specifies `base_url`, `default_model`, `model_allowlist` (restricts which models can be used), `api_key_env` (pulled from environment, never stored in the config row), `local` flag (required for private IPs, enforces `localhost`/private address check), `capabilities` (`ModelCapabilities` at `providers.py:237-253`: `streaming`, `tools`, `strict_tools`, `structured_output`, `vision`, `reasoning_controls`, `context_window`). Local endpoints using HTTP passthrough must be flagged `local: true` (`providers.py:333-346`).

**Model limits** (`known_model_limits.py`): A curated map of ~200 models with `(context_window, max_output_tokens)` tuples, auto-generated from OpenRouter's catalog. Ranges from 8K (older DeepSeek distill) to 2M (Gemini 1.5 Pro) context. These are used as fallbacks when the provider doesn't advertise limits.

**Model catalog** (`model_catalog.py:9-37`): `ModelDescriptor` carries `context_window`, `max_output_tokens`, `pricing` (decimal strings by billing unit), `input_modalities`, `output_modalities`, `reasoning_mandatory`, `route_limits` (per-provider route context windows verified via endpoint probing).

**Role-based model selection**: A `ProviderRegistry` (`providers.py:6500-6543`) supports `select(local_only=..., residency=..., required=...)` for capability-based routing. The `route()` method (`providers.py:6545`) orders providers by cost, locality, and capability requirements. Each mission can specify its own `provider_id` and `model` for the supervisor and individual specialists (`orchestration.py:565-576`).

**Cost management** (`domain.py:2560-2569`): `RunBudget` caps `max_tokens`, `max_cost_usd`, `max_tool_calls`. The API layer enforces `MAX_API_MISSION_TOKENS=200K` and `MAX_API_MISSION_COST_USD=100` (`missions.py:60-64`). Per-model pricing from `model_pricing.py` converts usage to cost via `combined_billed_cost()` and `usage_cost_usd()`.

**Context-window management** (`context.py:54-80`): Default output is `min(window/4, published_limit, 200K — input)`, with a floor of 8,192 tokens. The `WORKING_CONTEXT_CEILING=200K` prevents 1M+ models from bloating context before compaction runs. `CONTEXT_TARGET_FRACTION=0.75` sets when compaction triggers — at 75% of the effective window. Hard capacity checks still use the real model window.

**Harness support**: Beyond direct provider connections, Nebula supports Codex App Server (via the `claude-agent-sdk`) and Grok ACP as "harnesses" — alternative agent runtimes with their own model access, connected via stdio/Unix socket/WebSocket with bearer auth (`domain.py:414-442`). Harnesses are full agent sessions: the model in the harness makes its own tool calls, while Nebula's policy layer still intercepts and approves them.

> **Editor's note.** Correction: ProviderFlavor lists 25 kinds (including custom, microsoft_foundry, orcarouter, litellm), not 17. The harnesses are Codex App Server and Grok ACP; claude_agent_sdk is a retired kind kept only for old records. The API mission limits are ceilings on requested budgets, which default to unbounded.

Citations: [src/nebula/v3/providers.py:198-223](https://github.com/berylliumsec/nebula/blob/7332d9a05127933d2cc649e6797c9586466cfa8a/src/nebula/v3/providers.py#L198-L223) · [src/nebula/v3/providers.py:237-363](https://github.com/berylliumsec/nebula/blob/7332d9a05127933d2cc649e6797c9586466cfa8a/src/nebula/v3/providers.py#L237-L363) · [src/nebula/v3/providers.py:6500-6543](https://github.com/berylliumsec/nebula/blob/7332d9a05127933d2cc649e6797c9586466cfa8a/src/nebula/v3/providers.py#L6500-L6543) · [src/nebula/v3/known_model_limits.py:1-60](https://github.com/berylliumsec/nebula/blob/7332d9a05127933d2cc649e6797c9586466cfa8a/src/nebula/v3/known_model_limits.py#L1-L60) · [src/nebula/v3/context.py:54-80](https://github.com/berylliumsec/nebula/blob/7332d9a05127933d2cc649e6797c9586466cfa8a/src/nebula/v3/context.py#L54-L80) · [src/nebula/v3/missions.py:60-65](https://github.com/berylliumsec/nebula/blob/7332d9a05127933d2cc649e6797c9586466cfa8a/src/nebula/v3/missions.py#L60-L65)
