Skip to content

Feat:Openrouter/Anthropic/grok-support#231

Merged
Wirasm merged 14 commits intocoleam00:mainfrom
Chillbruhhh:feature/openrouter-support
Sep 22, 2025
Merged

Feat:Openrouter/Anthropic/grok-support#231
Wirasm merged 14 commits intocoleam00:mainfrom
Chillbruhhh:feature/openrouter-support

Conversation

@Chillbruhhh
Copy link
Copy Markdown

@Chillbruhhh Chillbruhhh commented Aug 15, 2025

Pull Request

Summary

Added OpenRouter LLM provider support and EMBEDDING_PROVIDER to database setting that allows different embeddings model to be selected

Changes Made

  • Added OpenRouter as LLM provider option - Access to 200+ models from Anthropic, OpenAI, Meta, Google, etc.
  • Added EMBEDDING_PROVIDER setting in database migration
  • Enhanced credential service validation with auto-recovery for missing provider settings
  • Updated comprehensive documentation across RAG guides, configuration docs, and getting started
  • Added mixed provider support - Use OpenRouter for LLM + OpenAI/Google/Ollama for embeddings
  • Improved test coverage with OpenRouter-specific embedding fallback tests

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring

Affected Services

  • Frontend (React UI)
  • Server (FastAPI backend)
  • MCP Server (Model Context Protocol)
  • Agents (PydanticAI service)
  • Database (migrations/schema)
  • Docker/Infrastructure
  • Documentation site

Testing

  • All existing tests pass
  • Added new tests for new functionality
  • Manually tested affected user flows
  • Docker builds succeed for all services

Test Evidence

# Backend tests with new OpenRouter embedding fallback tests
cd python && python -m pytest tests/test_async_llm_provider_service.py -v

# Frontend tests
cd archon-ui-main && npm run test

# Integration test - RAG operations with OpenRouter LLM + OpenAI embeddings
# Tested crawling: https://docs.langchain.com/llms.txt
# Result: ✅ No "Unsupported LLM provider: false" errors

Checklist

  • My code follows the service architecture patterns
  • If using an AI coding assistant, I used the CLAUDE.md rules
  • I have added tests that prove my fix/feature works
  • All new and existing tests pass locally
  • My changes generate no new warnings
  • I have updated relevant documentation
  • I have verified no regressions in existing features

Breaking Changes

Add this table to your database if you havent! (added to the migration table)

-- Added EMBEDDING_PROVIDER setting
INSERT INTO archon_settings (key, value, is_encrypted, category, description) VALUES
('EMBEDDING_PROVIDER', 'openai', false, 'rag_strategy', 'Embedding provider to use: openai, ollama, or google')
ON CONFLICT (key) DO NOTHING;

Additional Notes

Screenshot 2025-08-22 071535

Key Technical Details:

  • OpenRouter Limitation: OpenRouter doesn't provide embedding models, so the system intelligently falls back to OpenAI's embedding API when OpenRouter is selected for embeddings
  • Auto-Recovery: If EMBEDDING_PROVIDER setting is missing, the system automatically creates it with safe defaults
  • Mixed Provider Architecture: Users can now use OpenRouter for chat models while using OpenAI, Google, or Ollama for embeddings
  • Database Migration: Safe migration with ON CONFLICT (key) DO NOTHING for existing installations

Documentation Updated:

  • RAG configuration guide with OpenRouter section
  • Getting started guide with provider options
  • Configuration documentation with mixed provider setup
  • README feature list and prerequisites

Recommended Setup for OpenRouter Users:

  • LLM Provider: OpenRouter (for access to 200+ models)
  • Embedding Provider: OpenAI (for reliable embeddings)
  • Requires both OpenRouter and OpenAI API keys

Summary by CodeRabbit

  • New Features

    • Added OpenRouter and Grok provider support with provider-specific defaults.
    • Introduced server-side provider connectivity checks and status indicators in settings.
    • Persisted per-provider chat/embedding model selections across sessions.
    • Enabled provider-aware code extraction and summarization flows.
  • Improvements

    • Smarter embedding routing based on selected model (Google/OpenAI).
    • Enhanced contextual embeddings with provider-aware defaults and parameter handling.
    • Updated provider UI: ordering, styling, alerts, and visibility.
    • More reliable health checks and fallback behavior across providers.
    • Faster, periodic credential and connectivity re-validation.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants