Skip to content

[AI Engine] MVP — provider-agnostic LLM gateway + 3 connectors + recommendation migration #329

@thewrz

Description

@thewrz

Tracking issue for the MVP of the AI Engine Back-end Redesign work-track.

Scope (MVP)

Implement the design in docs/superpowers/specs/2026-05-24-admin-ai-oauth-design.md:

  • services/llm/ provider-agnostic dispatch gateway
  • Three connector types:
    • OpenAI API key
    • Anthropic API key (replaces hardcoded ANTHROPIC_API_KEY env var)
    • Custom OpenAI-compatible endpoint URL (for DJs to point at Hermes Agent / LiteLLM / Ollama)
  • Per-DJ /settings/ai UI + admin /admin/ai UI
  • Recommendation engine (services/recommendation/llm_client.py) migrated to the gateway with zero observable behavior change
  • Alembic migration creates llm_connectors, llm_call_log, llm_audit_event + 3 new system_settings columns + data-migrates the env-var key into a default connector
  • Test suites: gateway, adapters, tool translation, URL validation, API endpoints, recommendation regression
  • Frontend tests for both new pages

Out of scope

All deferred work is filed as separate issues under this milestone. See §11 of the spec.

Implementation directive

Per spec §10.1, the implementer agent should:

  1. Read the spec in full
  2. Confirm working on a feature branch (worktree-feat+admin-ai-oauth or similar — never main)
  3. Read CLAUDE.md and related memory ([[llm-oauth-gateway]], [[feedback-litellm-avoid]])
  4. Use superpowers:writing-plans to produce a phased plan from the spec
  5. Use superpowers:subagent-driven-development to dispatch parallel sub-agents (see spec §10.1 for the 7 suggested slots)
  6. Run full local CI (the "push to testing" workflow from MEMORY.md) before pushing
  7. Open the PR with this issue linked

Acceptance criteria

Per spec §9. Move this issue to In Review when the PR opens, and to Complete when it merges.


Integration branch (updated 2026-05-25)

This work-track merges into the long-lived integration branch epic/ai-engine, not main.

  • Branch this task off the epic: git fetch origin && git checkout -b feat/issue-329 origin/epic/ai-engine
  • Open its PR with base = epic/ai-engine (gh pr create --base epic/ai-engine)
  • Full CI + CodeRabbit review + manual testing still gate every sub-PR into the epic
  • epic/ai-enginemain is a single final merge after end-to-end validation

See spec §10.0 (Branching & Integration Strategy) for details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-engineAI Engine Back-end Redesign (provider-agnostic LLM gateway + OAuth)enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions