[Design Proposal] Consume existing LLM Providers from an Agent #385
menakaj
started this conversation in
Design Proposals
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
Agent developers need to configure AI capabilities (LLM providers, MCP tools) for their agents across multiple environments (dev, staging, prod). Currently, the system lacks:
No AI Resource Catalog: Developers cannot see which LLM providers and MCP proxies are approved and available for use in their organization.
No Environment-Specific Configuration: Developers must configure AI resources separately for each environment, leading to configuration drift and manual overhead.
No Agent-Level Guardrails: Developers cannot apply agent-specific content filters or rate limits on top of organization-level policies.
No Unified Configuration Model: Creating LLM proxies requires understanding low-level gateway concepts instead of high-level agent configuration.
No Configuration Versioning: Changes to agent AI configuration are not tracked or versioned, making rollbacks and audits difficult.
No Deployment Automation: After configuring AI resources, developers must manually deploy to each environment's gateway.
User Stories
Agent Developer (Delia)
AI Resource Discovery:
Agent Model Configuration:
Agent Tool Configuration:
Deployment & Testing:
Monitoring & Debugging:
Existing Solutions
N/A
Proposed Solution
Overview
This proposal introduces agent-level AI configuration that allows developers to consume organization-approved LLM providers and MCP proxies through a simplified, environment-aware interface. The system abstracts away low-level gateway concepts (LLM proxies) and presents a unified "Model Configuration" entity that groups environment-specific deployments.
Key Concepts
AI Resource Catalog: Organization-level registry of approved LLM providers and MCP proxies (managed by Adam) that developers can browse and select.
Agent Model Configuration: A grouped entity representing "which LLM provider my agent uses" with per-environment selections. Translates to LLM proxies deployed to each environment's gateway.
Agent Tool Configuration: A grouped entity representing "which MCP tools my agent uses" with per-environment selections. Translates to MCP proxy references deployed to each environment's gateway.
Environment-Specific Overrides: Per-environment configuration (dev uses GPT-3.5, prod uses GPT-4; dev has debug tools, prod has read-only tools).
Agent-Level Guardrails: Additional content filters, rate limits, and policies applied on top of organization defaults.
Deployment Abstraction: Developers work with logical configurations; Agent Manager translates to LLM proxies and deploys to gateways automatically.
Design
Architecture Overview
The architecture follows a catalog-based discovery pattern with automatic proxy provisioning:
Design Decisions
1. Catalog Pattern:
in_catalogFlag vs. Separate TableDecision: Add
in_catalogboolean column to existingartifactstable.Rationale:
Implementation:
Catalog Query Pattern:
SELECT * FROM artifacts WHERE kind = 'llmProvider' AND in_catalog = TRUE2. Environment Resolution: OpenChoreo vs. Local Storage
Decision: Environments are resolved from OpenChoreo, NOT stored in local database.
Rationale:
gateway_environment_mappings)Implementation:
environment_uuidcolumnsInfraResourceManager.ListOrgEnvironments()Database Pattern:
3. Configuration Scope: Per-Agent vs. Per-Project
Decision: One configuration per agent (scoped to agent).
Rationale:
Implementation:
CONSTRAINT uq_agent_config_name UNIQUE(agent_id, name, organization_uuid)4. Secret Management: Direct Storage vs. Secret References
Decision: Store secret references (e.g.,
choreo:///default/secret/my-config-url), NOT actual secret values.Rationale:
Implementation (TODO - pending OpenChoreo API):
Example:
5. Gateway Selection: First-Match vs. Priority-Based
Decision: Priority-based gateway selection with AI-first preference.
Rationale:
Implementation:
Error Handling:
500 Internal Server Error500 Internal Server Error6. Transaction Boundaries: Single-System vs. Distributed
Decision: Database transaction + best-effort cleanup for external systems.
Rationale:
Implementation:
7. API Response Design: Full Model vs. Subset
Decision: Return only necessary fields in API responses, hide internal details.
Rationale:
Implementation:
API Surface
1. Catalog Endpoints
List Catalog Resources:
Implementation:
kind=llmProvider: Queryartifacts WHERE kind='llmProvider' AND in_catalog=TRUEkind=agent: Fetch from OpenChoreo viaInfraResourceManager.ListComponents(orgName, projectName)kind=mcp: Fetch MCP proxies from OpenChoreo2. Agent Model Configuration Endpoints
Create Configuration:
List Configurations:
Get Configuration:
Update Configuration:
Delete Configuration:
Data Model Changes
New Tables
1. Agent Configurations:
2. Environment Agent Model Mapping:
3. Agent Environment Config Variables:
Modified Tables
Artifacts Table:
Component Interactions
Error Handling Flow:
UX
Out of Scope
Alternatives Considered
No response
Open Questions
No response
Milestones
Add
in_catalogcolumn to artifacts table via Migration 008. Implement catalog repository with query methods supporting filtering by kind (llmProvider/agent/mcp) and pagination. Create catalog service and REST endpointGET /orgs/{orgName}/catalogBuild React components for catalog browser with filtering capabilities by kind and search. Implement provider detail view showing capabilities, rate limits, and cost estimates. Add pagination controls and loading states with proper error handling.
Create database schema with three tables (
agent_configurations,env_agent_model_mapping,agent_env_config_variables_mapping). Implement Go models with corrected GORM tags and repository layer. Build AgentConfigurationService with full CRUD operations: Create with proxy provisioning loop (create proxy, deploy to gateway with AI-first selection, generate API key, resolve URL), Update with environment diff calculation and smart redeployment, Delete with full cleanup. Implement all REST endpoints (POST/GET/PUT/DELETE/model-configs) with transaction handling, rollback on errors, and security-enforced response DTOs.Build configuration form with environment selector and provider picker integrated with catalog. Create list view, detail view with environment variable display, and validation error handling. Add loading states for async operations.
Integrate with openchoreo secret management implementation for storing configuration
Beta Was this translation helpful? Give feedback.
All reactions