diff --git a/bin/deepdive_synthesis.py b/bin/deepdive_synthesis.py index d2e33f02..f0060d0d 100644 --- a/bin/deepdive_synthesis.py +++ b/bin/deepdive_synthesis.py @@ -46,7 +46,7 @@ Write in tight, professional intelligence style. No fluff.""" class SynthesisEngine: def __init__(self, provider: str = None): self.provider = provider or os.environ.get("DEEPDIVE_LLM_PROVIDER", "openai") - self.api_key = os.environ.get("OPENAI_API_KEY") or os.environ.get("ANTHROPIC_API_KEY") + self.api_key = os.environ.get("OPENAI_API_KEY") or os.environ.get("OPENROUTER_API_KEY") def synthesize(self, items: List[Dict], date: str) -> str: """Generate briefing from ranked items.""" @@ -55,8 +55,8 @@ class SynthesisEngine: if self.provider == "openai": return self._call_openai(prompt) - elif self.provider == "anthropic": - return self._call_anthropic(prompt) + elif self.provider == "openrouter": + return self._call_openrouter(prompt) else: return self._fallback_synthesis(items, date) @@ -89,14 +89,17 @@ class SynthesisEngine: print(f"[WARN] OpenAI synthesis failed: {e}") return self._fallback_synthesis_from_prompt(prompt) - def _call_anthropic(self, prompt: str) -> str: - """Call Anthropic API for synthesis.""" + def _call_openrouter(self, prompt: str) -> str: + """Call OpenRouter API for synthesis (Gemini 2.5 Pro).""" try: - import anthropic - client = anthropic.Anthropic(api_key=self.api_key) + import openai + client = openai.OpenAI( + api_key=self.api_key, + base_url="https://openrouter.ai/api/v1" + ) response = client.messages.create( - model="claude-3-haiku-20240307", # Cost-effective + model="google/gemini-2.5-pro", # Replaces banned Anthropic max_tokens=2000, temperature=0.3, system="You are an expert AI research analyst. Be concise and actionable.", @@ -104,7 +107,7 @@ class SynthesisEngine: ) return response.content[0].text except Exception as e: - print(f"[WARN] Anthropic synthesis failed: {e}") + print(f"[WARN] OpenRouter synthesis failed: {e}") return self._fallback_synthesis_from_prompt(prompt) def _fallback_synthesis(self, items: List[Dict], date: str) -> str: diff --git a/config/deepdive_sources.yaml b/config/deepdive_sources.yaml index 6d9da62d..2513fde6 100644 --- a/config/deepdive_sources.yaml +++ b/config/deepdive_sources.yaml @@ -53,8 +53,8 @@ feeds: poll_interval_hours: 12 enabled: true - anthropic_news: - name: "Anthropic News" + anthropic_news_feed: # Competitor monitoring + name: "Anthropic News (competitor monitor)" url: "https://www.anthropic.com/news" type: scraper # Custom scraper required poll_interval_hours: 12 diff --git a/intelligence/deepdive/docker-compose.yml b/intelligence/deepdive/docker-compose.yml index 75654a84..27e43781 100644 --- a/intelligence/deepdive/docker-compose.yml +++ b/intelligence/deepdive/docker-compose.yml @@ -24,7 +24,7 @@ services: - deepdive-output:/app/output environment: - OPENAI_API_KEY=${OPENAI_API_KEY:-} - - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-} + - OPENROUTER_API_KEY=${OPENROUTER_API_KEY:-} # Replaces banned ANTHROPIC_API_KEY - ELEVENLABS_API_KEY=${ELEVENLABS_API_KEY:-} - TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN:-} - TELEGRAM_HOME_CHANNEL=${TELEGRAM_HOME_CHANNEL:-} diff --git a/lazarus-registry.yaml b/lazarus-registry.yaml index 91237814..4a864fb9 100644 --- a/lazarus-registry.yaml +++ b/lazarus-registry.yaml @@ -14,11 +14,8 @@ fleet: - provider: kimi-coding model: kimi-k2.5 timeout: 120 - - provider: anthropic - model: claude-sonnet-4-20250514 - timeout: 120 - provider: openrouter - model: anthropic/claude-sonnet-4-20250514 + model: google/gemini-2.5-pro timeout: 120 - provider: ollama model: gemma4:12b @@ -38,12 +35,12 @@ fleet: - provider: kimi-coding model: kimi-k2.5 timeout: 120 - - provider: anthropic - model: claude-sonnet-4-20250514 - timeout: 120 - provider: openrouter - model: anthropic/claude-sonnet-4-20250514 + model: google/gemini-2.5-pro timeout: 120 + - provider: ollama + model: gemma4:latest + timeout: 300 health_endpoints: gateway: http://127.0.0.1:8645 auto_restart: true @@ -55,15 +52,15 @@ fleet: host: UNKNOWN vps_provider: UNKNOWN primary: - provider: anthropic - model: claude-sonnet-4-20250514 + provider: kimi-coding + model: kimi-k2.5 fallback_chain: - - provider: anthropic - model: claude-sonnet-4-20250514 - timeout: 120 - provider: openrouter - model: anthropic/claude-sonnet-4-20250514 + model: google/gemini-2.5-pro timeout: 120 + - provider: ollama + model: gemma4:latest + timeout: 300 auto_restart: true known_issues: - timeout_choking_on_long_operations @@ -72,15 +69,15 @@ fleet: host: UNKNOWN vps_provider: UNKNOWN primary: - provider: anthropic - model: claude-sonnet-4-20250514 + provider: kimi-coding + model: kimi-k2.5 fallback_chain: - - provider: anthropic - model: claude-sonnet-4-20250514 - timeout: 120 - provider: openrouter - model: anthropic/claude-sonnet-4-20250514 + model: google/gemini-2.5-pro timeout: 120 + - provider: ollama + model: gemma4:latest + timeout: 300 auto_restart: true provider_health_matrix: kimi-coding: @@ -89,12 +86,6 @@ provider_health_matrix: last_checked: '2026-04-07T18:43:13.674848+00:00' rate_limited: false dead: false - anthropic: - status: healthy - last_checked: '2026-04-07T18:43:13.675004+00:00' - rate_limited: false - dead: false - note: '' openrouter: status: healthy last_checked: '2026-04-07T02:55:00Z'