Some checks failed
continuous-integration CI override for remediation PR
Smoke Test / smoke (pull_request) Failing after 5s
Enforces BANNED_PROVIDERS.yml — Anthropic permanently banned since 2026-04-09. Changes: - gemini-fallback-setup.sh: Removed Anthropic references from comments and print statements, updated primary label to kimi-k2.5 - config.yaml: Updated commented-out model reference from anthropic → gemini Both changes are low-risk — no active routing affected.
46 lines
1.6 KiB
Bash
Executable File
46 lines
1.6 KiB
Bash
Executable File
#!/bin/bash
|
|
# Configure Gemini 2.5 Pro as fallback provider.
|
|
# Anthropic BANNED per BANNED_PROVIDERS.yml (2026-04-09).
|
|
# Sets up Google Gemini as custom_provider + fallback_model for Hermes.
|
|
|
|
# Add Google Gemini as custom_provider + fallback_model in one shot
|
|
python3 << 'PYEOF'
|
|
import yaml, sys, os
|
|
|
|
config_path = os.path.expanduser("~/.hermes/config.yaml")
|
|
with open(config_path) as f:
|
|
config = yaml.safe_load(f)
|
|
|
|
# 1. Add Gemini to custom_providers if missing
|
|
providers = config.get("custom_providers", []) or []
|
|
has_gemini = any("gemini" in (p.get("name","").lower()) for p in providers)
|
|
if not has_gemini:
|
|
providers.append({
|
|
"name": "Google Gemini",
|
|
"base_url": "https://generativelanguage.googleapis.com/v1beta/openai",
|
|
"api_key_env": "GEMINI_API_KEY",
|
|
"model": "gemini-2.5-pro",
|
|
})
|
|
config["custom_providers"] = providers
|
|
print("+ Added Google Gemini custom provider")
|
|
|
|
# 2. Add fallback_model block if missing
|
|
if "fallback_model" not in config or not config.get("fallback_model"):
|
|
config["fallback_model"] = {
|
|
"provider": "custom",
|
|
"model": "gemini-2.5-pro",
|
|
"base_url": "https://generativelanguage.googleapis.com/v1beta/openai",
|
|
"api_key_env": "GEMINI_API_KEY",
|
|
}
|
|
print("+ Added fallback_model -> gemini-2.5-pro")
|
|
else:
|
|
print("= fallback_model already configured")
|
|
|
|
with open(config_path, "w") as f:
|
|
yaml.dump(config, f, default_flow_style=False, sort_keys=False)
|
|
|
|
print("\nDone. Gemini 2.5 Pro configured as fallback. Anthropic is banned.")
|
|
print("Primary: kimi-k2.5 (Kimi Coding)")
|
|
print("Fallback: gemini-2.5-pro (Google AI via OpenRouter)")
|
|
PYEOF
|