agentleFS
ScientiaCapitalScientiaCapital/model-finops/CLAUDE.md

model-finops

CLAUDE.md0 starsChanged 4 months agoMITView on GitHub

Intelligent LLM router that reduces AI API costs by routing prompts to the most cost-efficient model — FastAPI backend with semantic caching (pgvector), multi-tenant RLS, MCP integration for Claude Desktop, and a Next.js cost dashboard. Requires: SUPABASE_URL, SUPABASE_ANON_KEY, SUPABASE_SERVICE_KEY, GOOGLE_API_KEY, ANTHROPIC_API_KEY, OPENROUTER_API_KEY

  • Reads credentials

The file

We split this CLAUDE.md into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No OpenAI as primary provider — Anthropic Claude or OpenRouter only

    line 54
  2. Distinctive:

    All cost calculations in USD cents for precision

    line 56

≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md — model-finops

Intelligent LLM router that reduces AI API costs by routing prompts to the most cost-efficient model — FastAPI backend with semantic caching (pgvector), multi-tenant RLS, MCP integration for Claude Desktop, and a Next.js cost dashboard.

Stack

  • Backend: FastAPI + Python 3.10+
  • Frontend: Next.js 15 + Tailwind CSS + shadcn/ui
  • Database: Supabase (PostgreSQL + pgvector for semantic caching)
  • AI: Multi-provider — Anthropic Claude, Google Gemini, Cerebras, OpenRouter (NO OpenAI)
  • Deployment: RunPod (backend) + Vercel (frontend dashboard)
  • Infrastructure: Docker, MCP server for Claude Desktop

Quick Start

./init.sh

Key Files

  • app/main.py — FastAPI entry point
  • app/routing/engine.py — RoutingEngine with ComplexityStrategy / LearningStrategy / HybridStrategy
  • app/database/cost_tracker_async.py — Semantic cache with 95% similarity threshold
  • app/database/supabase_client.py — Async Supabase wrapper
  • app/embeddings/generator.py — sentence-transformers (all-MiniLM-L6-v2, 384D)
  • app/experiments/tracker_async.py — A/B testing framework
  • app/auth.py — JWT auth middleware
  • mcp/server.py — MCP server for Claude Desktop
  • frontend/ — Next.js cost dashboard
  • migrations/ — Supabase SQL migrations (pgvector, RLS)
  • requirements.txt — Python deps

Development

# Backend
python app/main.py
# or: uvicorn app.main:app --reload

# Frontend
cd frontend && npm run dev

# Tests
pytest tests/

Environment

Requires: SUPABASE_URL, SUPABASE_ANON_KEY, SUPABASE_SERVICE_KEY, GOOGLE_API_KEY, ANTHROPIC_API_KEY, OPENROUTER_API_KEY

Policy

  • No OpenAI as primary provider — Anthropic Claude or OpenRouter only
  • Routing logic lives exclusively in app/routing/
  • All cost calculations in USD cents for precision
  • Provider classes must implement send_message() method

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.