Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

### Added
- **Cheaper Inference provider** (`cheaperinference`) for standalone `bughunter` / `brain.py`: OpenAI-compatible gateway at `https://api.cheaperinference.com/v1` via `CHEAPER_INFERENCE_API_KEY`. Not in the auto-detect priority list; choose option 12 in `bughunter setup`, `BRAIN_PROVIDER=cheaperinference`, or `--provider cheaperinference`. Default model `gpt-5.4-mini` and a short curated model list (same pattern as Requesty).
- **Requesty provider** (`requesty`) for standalone `bughunter` / `brain.py`: OpenAI-compatible gateway at `https://router.requesty.ai/v1` via `REQUESTY_API_KEY` (optional `REQUESTY_BASE_URL`, e.g. `https://router.eu.requesty.ai/v1` for the EU region). Not in the auto-detect priority list; choose option 11 in `bughunter setup`, `BRAIN_PROVIDER=requesty`, or `--provider requesty`. Default model `anthropic/claude-sonnet-4-6` and a short curated model list (same pattern as OpenRouter).
- **Fluxion AI provider** (`fluxion`) for standalone `bughunter` / `brain.py` — optional OpenAI-compatible gateway at `https://fluxionai.world/v1` via `FLUXION_API_KEY`. Not the default; choose option 9 in `bughunter setup`, `BRAIN_PROVIDER=fluxion`, or `--provider fluxion`. README partner placement + setup docs link [docs](https://docs.fluxionai.world/user-guide/help-center) and [Model Plaza](https://fluxionai.world/model-plaza).
- **Claude Code plugin manifest** (`.claude-plugin/plugin.json`) — declares skills, commands, agents, and hooks so the repo passes Claude Code / marketplace plugin validation.
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,9 @@ bughunter v "finding" # short alias for validate
| **Fluxion** | Subscription / pay-as-you-go | Cloud | Fast | [fluxionai.world](https://fluxionai.world/register?source=github&campaign=github-awarexone&promo=AWAREXONE) → get API key · [docs](https://docs.fluxionai.world/user-guide/help-center) · [Model Plaza](https://fluxionai.world/model-plaza) |
| **LiteLLM** | Uses your existing provider keys | Cloud / self-hosted proxy | Fast | [docs.litellm.ai](https://docs.litellm.ai) → one gateway for 100+ models |
| **Requesty** | Pay-as-you-go | Cloud | Fast | [app.requesty.ai/api-keys](https://app.requesty.ai/api-keys) → get API key · [docs](https://docs.requesty.ai) |
| **Cheaper Inference** | Pay-as-you-go | Cloud | Fast | [cheaperinference.com/signup](https://cheaperinference.com/signup) → get API key |

BugHunter auto-detects providers in this order: **Ollama → Groq → DeepSeek → … → OrcaRouter → OpenRouter → Fluxion → Claude → OpenAI**. LiteLLM is opt-in (selected explicitly or when `LITELLM_API_KEY` is set) so it never preempts a provider you already configured. Requesty is opt-in the same way (selected explicitly or when `REQUESTY_API_KEY` is set); set `REQUESTY_BASE_URL=https://router.eu.requesty.ai/v1` to route through the EU region.
BugHunter auto-detects providers in this order: **Ollama → Groq → DeepSeek → … → OrcaRouter → OpenRouter → Fluxion → Claude → OpenAI**. LiteLLM is opt-in (selected explicitly or when `LITELLM_API_KEY` is set) so it never preempts a provider you already configured. Requesty is opt-in the same way (selected explicitly or when `REQUESTY_API_KEY` is set); set `REQUESTY_BASE_URL=https://router.eu.requesty.ai/v1` to route through the EU region. Cheaper Inference is opt-in too (selected explicitly or when `CHEAPER_INFERENCE_API_KEY` is set).

Switch providers or choose an installed Ollama model anytime: `bughunter setup`.
The setup can also be fully non-interactive:
Expand Down
32 changes: 30 additions & 2 deletions bughunter/brain.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
Brain — Multi-Provider LLM Reasoning Layer for Bug Bounty & VAPT
Supports: Ollama (local), Claude, OpenAI, Grok, Groq, DeepSeek,
Gemini, Kimi (Moonshot), Mistral, Together AI, Cerebras, Perplexity,
OpenRouter, OrcaRouter, Fluxion, Requesty
OpenRouter, OrcaRouter, Fluxion, Requesty, Cheaper Inference

Provider selection (in order of precedence):
1. BRAIN_PROVIDER env var (ollama | claude | openai | grok | groq | deepseek |
gemini | kimi | mistral | together | cerebras |
perplexity | openrouter | orcarouter | fluxion |
requesty)
requesty | cheaperinference)
2. Auto-detect: uses first provider whose API key / server is available

Model selection:
Expand All @@ -38,6 +38,7 @@
REQUESTY_API_KEY - Requesty (multi-model gateway, anthropic/claude-sonnet-4-6, etc.)
REQUESTY_BASE_URL - Requesty base URL (default: https://router.requesty.ai/v1,
EU: https://router.eu.requesty.ai/v1)
CHEAPER_INFERENCE_API_KEY - Cheaper Inference (multi-model gateway, gpt-5.4-mini, etc.)
OLLAMA_HOST — Ollama base URL (default: http://localhost:11434)

Default model priority (uses first available):
Expand Down Expand Up @@ -209,6 +210,7 @@ class LLMClient:
"orcarouter": "openai/gpt-4o",
"fluxion": "openai/gpt-4o",
"requesty": "anthropic/claude-sonnet-4-6",
"cheaperinference": "gpt-5.4-mini",
"litellm": "gpt-4o",
"ollama": None, # resolved dynamically
}
Expand Down Expand Up @@ -278,6 +280,7 @@ def __init__(self, provider: str | None = None, model: str | None = None):
"orcarouter": "ORCAROUTER_API_KEY",
"fluxion": "FLUXION_API_KEY",
"requesty": "REQUESTY_API_KEY",
"cheaperinference": "CHEAPER_INFERENCE_API_KEY",
# Kept last so auto-detect only reaches LiteLLM when LITELLM_API_KEY is
# set, and never preempts a directly-configured provider above.
"litellm": "LITELLM_API_KEY",
Expand Down Expand Up @@ -526,6 +529,20 @@ def _init_provider(self, provider: str) -> None:
self.available = True
self.description = "Requesty (multi-model gateway)"

elif provider == "cheaperinference":
key = os.environ.get("CHEAPER_INFERENCE_API_KEY", "")
if not key:
return
import requests
self._http = requests.Session()
self._http.headers.update({
"Authorization": f"Bearer {key}",
"Content-Type": "application/json",
})
self._api_base = "https://api.cheaperinference.com/v1"
self.available = True
self.description = "Cheaper Inference (multi-model gateway)"

elif provider == "litellm":
# LiteLLM routes by the model-name prefix (e.g. "anthropic/claude-...",
# "gemini/gemini-...", "bedrock/...") and reads each target provider's
Expand Down Expand Up @@ -558,6 +575,7 @@ def chat(self, model: str | None, system: str, user: str,
"openai", "grok", "groq", "deepseek",
"gemini", "kimi", "mistral", "together", "cerebras", "perplexity",
"openrouter", "orcarouter", "fluxion", "requesty",
"cheaperinference",
):
return self._chat_openai_compat(model, system, user, max_tokens, temperature)
except Exception as e:
Expand Down Expand Up @@ -753,6 +771,16 @@ def list_models(self) -> list[str]:
"gemini-3.5-flash",
"gpt-4o-mini@eu",
]
elif self.provider == "cheaperinference":
# Curated starter set; full catalog: GET https://api.cheaperinference.com/v1/models
return [
"gpt-5.4-mini",
"gpt-5.4",
"claude-sonnet-5",
"gemini-3.1-pro",
"deepseek-v4-flash",
"glm-5.3",
]
elif self.provider == "litellm":
return self._litellm_list_models()
return []
Expand Down
14 changes: 11 additions & 3 deletions bughunter/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
requesty - multi-model gateway, set REQUESTY_API_KEY
get key: https://app.requesty.ai/api-keys
docs: https://docs.requesty.ai
cheaperinference - multi-model gateway, set CHEAPER_INFERENCE_API_KEY
get key: https://cheaperinference.com/signup

Usage:
./engine.py setup one-time config wizard
Expand Down Expand Up @@ -272,6 +274,7 @@ def cmd_setup(args):
"9": ("fluxion", "Fluxion (multi-model) — needs FLUXION_API_KEY"),
"10": ("litellm", "LiteLLM (100+ providers) — uses per-provider keys or LITELLM_API_KEY"),
"11": ("requesty", "Requesty (multi-model) - needs REQUESTY_API_KEY"),
"12": ("cheaperinference", "Cheaper Inference (multi-model) - needs CHEAPER_INFERENCE_API_KEY"),
}

requested_provider = (
Expand Down Expand Up @@ -308,6 +311,7 @@ def cmd_setup(args):
"orcarouter": "ORCAROUTER_API_KEY",
"fluxion": "FLUXION_API_KEY",
"requesty": "REQUESTY_API_KEY",
"cheaperinference": "CHEAPER_INFERENCE_API_KEY",
}

if provider in env_map:
Expand Down Expand Up @@ -411,6 +415,7 @@ def cmd_providers(args):
"orcarouter": "ORCAROUTER_API_KEY",
"fluxion": "FLUXION_API_KEY",
"requesty": "REQUESTY_API_KEY",
"cheaperinference": "CHEAPER_INFERENCE_API_KEY",
}
tier = {
"ollama": "FREE (local)", "groq": "FREE tier",
Expand All @@ -420,6 +425,7 @@ def cmd_providers(args):
"orcarouter": "subscription",
"fluxion": "subscription",
"requesty": "pay-as-you-go",
"cheaperinference": "pay-as-you-go",
}

print(f"\n {'PROVIDER':<12} {'TIER':<16} {'STATUS':<20} {'NOTE'}")
Expand Down Expand Up @@ -795,7 +801,7 @@ def main():
"""),
)
parser.add_argument("--provider", "-p",
help="Force provider: ollama / groq / deepseek / claude / openai / grok / openrouter / orcarouter / fluxion / litellm / requesty")
help="Force provider: ollama / groq / deepseek / claude / openai / grok / openrouter / orcarouter / fluxion / litellm / requesty / cheaperinference")
parser.add_argument("--model", "-m", help="Force model for this invocation (for example qwen3:14b)")
parser.add_argument("--no-banner", action="store_true", help="Suppress banner")

Expand All @@ -805,7 +811,8 @@ def main():
p_setup.add_argument(
"--provider", dest="setup_provider",
choices=["ollama", "groq", "deepseek", "claude", "openai", "grok",
"openrouter", "orcarouter", "fluxion", "litellm", "requesty"],
"openrouter", "orcarouter", "fluxion", "litellm", "requesty",
"cheaperinference"],
help="Provider to persist (skips the provider prompt)",
)
p_setup.add_argument(
Expand Down Expand Up @@ -858,7 +865,8 @@ def main():
cfg = load_config()
for env_var in ("GROQ_API_KEY", "DEEPSEEK_API_KEY", "ANTHROPIC_API_KEY",
"OPENAI_API_KEY", "XAI_API_KEY", "OPENROUTER_API_KEY",
"ORCAROUTER_API_KEY", "FLUXION_API_KEY", "REQUESTY_API_KEY"):
"ORCAROUTER_API_KEY", "FLUXION_API_KEY", "REQUESTY_API_KEY",
"CHEAPER_INFERENCE_API_KEY"):
if not os.environ.get(env_var) and cfg.get(env_var):
os.environ[env_var] = cfg[env_var]

Expand Down
3 changes: 2 additions & 1 deletion config.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"openrouter": "OPENROUTER_API_KEY=... (anthropic/claude-sonnet-4.6 / openai/gpt-4o / …)",
"orcarouter": "ORCAROUTER_API_KEY=... (openai/gpt-4o / orcarouter/auto / …)",
"fluxion": "FLUXION_API_KEY=... (openai/gpt-4o / … — https://fluxionai.world/v1)",
"requesty": "REQUESTY_API_KEY=... (anthropic/claude-sonnet-4-6 / openai/gpt-4o-mini / ...)"
"requesty": "REQUESTY_API_KEY=... (anthropic/claude-sonnet-4-6 / openai/gpt-4o-mini / ...)",
"cheaperinference": "CHEAPER_INFERENCE_API_KEY=... (gpt-5.4-mini / claude-sonnet-5 / ...)"
}
}
38 changes: 37 additions & 1 deletion tests/test_brain_auto_detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def brain_module(monkeypatch):
for env in (
"BRAIN_PROVIDER", "ANTHROPIC_API_KEY", "OPENAI_API_KEY", "XAI_API_KEY",
"OPENROUTER_API_KEY", "ORCAROUTER_API_KEY", "FLUXION_API_KEY",
"REQUESTY_API_KEY", "REQUESTY_BASE_URL",
"REQUESTY_API_KEY", "REQUESTY_BASE_URL", "CHEAPER_INFERENCE_API_KEY",
):
monkeypatch.delenv(env, raising=False)
import brain
Expand Down Expand Up @@ -245,3 +245,39 @@ def test_requesty_base_url_override(brain_module, monkeypatch):

def test_requesty_is_opt_in_only(brain_module):
assert "requesty" not in brain_module.LLMClient.PROVIDER_PRIORITY


def test_cheaperinference_key_jumps_to_front(brain_module, monkeypatch):
monkeypatch.setenv("CHEAPER_INFERENCE_API_KEY", "ci_live_test")
client = brain_module.LLMClient.__new__(brain_module.LLMClient)
client.available = False
tracker = _Tracker(available_provider="cheaperinference")
tracker.bind(client)

chosen = brain_module.LLMClient._auto_detect(client)

assert chosen == "cheaperinference"
assert tracker.calls[0] == "cheaperinference"


def test_cheaperinference_init_sets_api_base(brain_module, monkeypatch):
monkeypatch.setenv("CHEAPER_INFERENCE_API_KEY", "ci_live_test")
client = brain_module.LLMClient.__new__(brain_module.LLMClient)
client.available = False
client._ollama = None
client._http = None
client.description = ""
client.provider = "cheaperinference"

brain_module.LLMClient._init_provider(client, "cheaperinference")

assert client.available is True
assert client._api_base == "https://api.cheaperinference.com/v1"
assert client._http.headers["Authorization"] == "Bearer ci_live_test"
assert "cheaper inference" in client.description.lower()
assert brain_module.LLMClient.DEFAULT_MODELS["cheaperinference"] == "gpt-5.4-mini"
assert "gpt-5.4-mini" in brain_module.LLMClient.list_models(client)


def test_cheaperinference_is_opt_in_only(brain_module):
assert "cheaperinference" not in brain_module.LLMClient.PROVIDER_PRIORITY
2 changes: 1 addition & 1 deletion tests/test_brain_litellm.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"MOONSHOT_API_KEY", "MISTRAL_API_KEY", "TOGETHER_API_KEY",
"CEREBRAS_API_KEY", "PERPLEXITY_API_KEY", "OPENROUTER_API_KEY",
"ORCAROUTER_API_KEY", "LITELLM_API_KEY", "LITELLM_API_BASE",
"LITELLM_BASE_URL", "REQUESTY_API_KEY",
"LITELLM_BASE_URL", "REQUESTY_API_KEY", "CHEAPER_INFERENCE_API_KEY",
)


Expand Down