Markdown Converter
Agent skill for markdown-converter
**Production-ready multi-provider AI orchestration platform** built with FastAPI and React. Routes AI requests to OpenAI, Anthropic, Google, xAI with intelligent provider selection, automatic fallback, cost tracking, and authentication.
Sign in to like and favorite skills
Production-ready multi-provider AI orchestration platform built with FastAPI and React. Routes AI requests to OpenAI, Anthropic, Google, xAI with intelligent provider selection, automatic fallback, cost tracking, and authentication.
Primary: franklin_backend/ - Full production system
/auth, /orchestrator, /usage, /billing, /agent, /pipeline, /memory, /job, /model, /dashboard, /api (ultimate executor)Legacy: backend_unified/ - Simple proxy (not actively maintained)
Option 1: PowerShell Scripts (Recommended for Windows)
.\Start_Backend.ps1 # Port 8000 .\Start_Frontend.ps1 # Port 8080
Option 2: Docker (Production-like)
docker-compose up -d # Services: API (8000), Frontend (8080), PostgreSQL, Redis
Option 3: Manual
# Backend cd franklin_backend python main.py # Frontend (new terminal) npm run dev
franklin_backend/.env.example to franklin_backend/.envProviderConfig.PROVIDERS in trinity_orchestrator_unified.py_call_<provider>() method (follow _call_openai pattern)Settings class.env.example and documentation# All /orchestrator and /usage endpoints require auth # Header: Authorization: Bearer <jwt_token> # Create user -> Login -> Get token -> Use token or create API key POST /auth/register -> POST /auth/login -> POST /orchestrator/run
# In routers, always: 1. Validate auth: current_user = Depends(get_current_user) 2. Check rate limits: check_rate_limit(user_id) 3. Call orchestrator: result = await orchestrator.run(...) 4. Log usage: UsageTracker.log_usage(db, user_id, ...)
enable_fallback=TrueUser: Auth accountsAPIKey: Programmatic access tokensUsageLog: Per-request cost/token trackingProvider: Provider health/configOrchestrationJob: Multi-step job trackingCachedResponse: Response cachingUses
pydantic-settings BaseSettings with .env loading:
from config import settings settings.OPENAI_API_KEY # Provider API keys settings.DATABASE_URL # PostgreSQL/SQLite settings.REDIS_URL # Cache (optional) settings.JWT_SECRET_KEY # Token signing settings.RATE_LIMIT_PER_MINUTE # Rate limits
fos_ prefix, SHA256 hashing)Every orchestrator call logs:
Access via
/usage/stats, /usage/billing/summary, /usage/billing/invoice
X-Request-ID header)logs/ directory# Edit .env files docker-compose up -d # Includes: API, Frontend, PostgreSQL, Redis, Nginx
# Install dependencies pip install -r franklin_backend/requirements.txt # Run with workers uvicorn main:app --host 0.0.0.0 --port 8000 --workers 4
pytest franklin_backend/tests/npm test*.test.{ts,tsx,py}POST /orchestrator/run - Execute AI request (requires auth)GET /orchestrator/providers - List available providersGET /orchestrator/health - Provider health statusPOST /auth/register - Create accountPOST /auth/login - Get JWT tokensPOST /auth/api-keys - Generate API keyGET /auth/me - Current user infoGET /usage/stats - Usage statisticsGET /usage/daily - Daily breakdownGET /usage/billing/summary - Billing summaryGET /usage/billing/invoice - Generate invoiceGET /billing/overview - Billing overview for all providersGET /billing/usage/{period} - Usage stats for period (7d, 30d, 90d)POST /billing/payment - Process paymentGET /billing/settings/{provider} - Get provider billing settingsPUT /billing/settings/{provider} - Update provider settingsGET /billing/alerts - Billing alerts and notificationsPOST /billing/alerts/{alert_id}/resolve - Resolve alertGET /billing/payments - Payment historySee API_DOCUMENTATION.md for full details.
# 1. Create router in franklin_backend/routers/ router = APIRouter(prefix="/myroute", tags=["MyTag"]) @router.get("/endpoint") async def my_endpoint(current_user: dict = Depends(get_current_user)): return {"data": "value"} # 2. Register in main.py from routers.myroute_router import router as myroute_router app.include_router(myroute_router)
# 1. Add to franklin_backend/core/database.py class MyModel(Base): __tablename__ = "my_table" id = Column(String, primary_key=True) # ... fields # 2. Restart app (tables auto-create on startup)
// src/components/MyComponent.tsx import { Button } from "@/components/ui/button" export const MyComponent = () => { return <Button>Click Me</Button> }
Ignore
TrinityAI/, GrokAEC-Elite/, Trinity ai consol/ - these are legacy/separate projects. Focus on root-level files.
async/awaitDepends() for auth, DB sessions{"success": bool, "error": str} patternlogger.info/error with structured data@/ for src/