AI Operations
Every AI/LLM call-site across the BRICK fleet — how it connects, which model, projected spend, and where you can switch providers. Policy: OCP proxy first (cost-free), API token is the paid fallback.
OCP proxy — live probe
base_url: https://ocp.lfiq.app/v1 intel OCP_BASE_URL set: yes models: claude-opus-4-7, claude-opus-4-6, claude-sonnet-4-6, claude-haiku-4-5-20251001
Intel runtime — active provider
getProvider(): ocp OCP_BASE_URL: https://ocp.lfiq.app/v1 ANTHROPIC_API_KEY: configured (failover)
Provider switch · Command Brick chat
The only runtime-switchable provider in the fleet (DB key ai.auth_provider). The switch lives in Command admin (auth boundary). Each option has a real trade-off — read before flipping.
Recommendation: keep api_key in production (tools matter more than the token cost), or oauth for local/dev. Revisit ocp only if/when the proxy supports caller tool-calling.
AI process registry
Code-derived catalogue — each row maps to a real file. Updated by hand as call-sites change.
| Surface | File | Method | Model | Tools | Status | Note |
|---|---|---|---|---|---|---|
| intel | ||||||
| Inbox → items extraction | app/lib/extractor.ts | Router → OCP | claude-sonnet-4-6 | no | On OCP | Text extraction via canonical llm.ts. OCP primary, Anthropic failover. |
| Knowledge-edge extraction | app/lib/extract-edges.ts | Router → OCP | claude-sonnet-4-6 | no | On OCP | Graph edge inference; text-only via canonical router. |
| AI reflections narrative | app/lib/reflections-narrative.ts | Router → OCP | claude-sonnet-4-6 | no | On OCP | Narrative summary via canonical router. |
| keystone | ||||||
| AIProvider fallback chain | automation/scripts/lib/ai_provider.py | OCP (free) | claude-sonnet-4-6 | no | On OCP | OCP tier-0 added 2026-05-30; falls back to paid Anthropic → Haiku → Ollama. |
| Agent trio loop (Kid/Gar/Ichiro) | automation/agent/agent_loop.py | Anthropic (paid) | claude-sonnet-4-6 | yes | Blocked · tool-use | Multi-turn MCP tool-use. OCP can't honor caller tools — stays on paid API. |
| command | ||||||
| Brick chat agent | backend/app/ai/agent_framework.py | Switchable | claude-sonnet-4-6 | yes | Switchable | ai.auth_provider: api_key (PAID + tools) | oauth (free + tools, local CLI only) | ocp (free but TEXT-ONLY — disables portfolio tools). |
| runner | ||||||
| App description suggestions | lib/gallery (suggest-description) | Router → OCP | claude-haiku-4-5 | no | On OCP | Text-only via canonical router. |
| Excel audit | app/api/excel-audit/route.ts | Anthropic (paid) | claude-sonnet-4-6 | yes | Blocked · tool-use | Layer-1 exception: tool-use. Cannot move to OCP. |
| Lease abstract extractor | lib/lease-abstract-extractor.ts | Anthropic (paid) | claude-sonnet-4-6 | yes | Blocked · tool-use | Layer-1 exception: structured tool-use extraction. |
| Explore agent loop | lib/agent/loop.ts | Anthropic (paid) | claude-sonnet-4-6 | yes | Blocked · tool-use | Anthropic tool-use loop over Postgres/Box/Knowledge tools. |
| FS Review import plan | app/api/fs-review/import/plan/route.ts | OpenAI (paid) | OpenAI (GPT) | yes | OpenAI path | OpenAI JSON-mode. Separate OpenAI bill; not a Claude/OCP path. |
| FS Review structured output | lib/fs-review-openai.ts | OpenAI (paid) | OpenAI (GPT) | yes | OpenAI path | OpenAI function-calling. Separate OpenAI bill. |
| Lease abstract CLI | scripts/lease-abstract-cli.ts | Anthropic (paid) | claude-sonnet-4-6 | yes | Local CLI | Manual local utility — low priority, run on demand. |
Projected spend
Estimate from list pricing × your assumptions. Not metered spend — live telemetry is a Phase-2 roadmap item.
| Paid surface | Model | $/call | $/mo (est.) |
|---|---|---|---|
| keystone/Agent trio loop (Kid/Gar/Ichiro) | claude-sonnet-4-6 | $0.0270 | $162 |
| command/Brick chat agent | claude-sonnet-4-6 | $0.0270 | $162 |
| runner/Excel audit | claude-sonnet-4-6 | $0.0270 | $162 |
| runner/Lease abstract extractor | claude-sonnet-4-6 | $0.0270 | $162 |
| runner/Explore agent loop | claude-sonnet-4-6 | $0.0270 | $162 |
| runner/FS Review import plan | OpenAI (GPT) | — | n/a |
| runner/FS Review structured output | OpenAI (GPT) | — | n/a |
| runner/Lease abstract CLI | claude-sonnet-4-6 | $0.0270 | $162 |
2 OpenAI surface(s) excluded from the Claude projection (separate OpenAI bill, distinct pricing).
Insights & recommendations
- Text generation is already free. Intel, keystone AIProvider, and the router-backed runner sites use the OCP subscription at $0 marginal cost.
- 4 tool-use sites can't move to OCP — verified the proxy ignores caller tools and answers as Claude Code. These stay on the paid Anthropic API and are the bulk of real spend.
- 2 OpenAI (FS Review) sites bill separately; moving them to Claude is a model swap, not just a transport change — validate output parity first.
- Command is a trade-off, not a free win: ocp removes its portfolio tools. Keep api_key/oauth unless you accept a text-only Brick.
Live telemetry — roadmap
Phase 2: add an `items.ai_usage` sink to the canonical llm.ts / brick_llm.py routers (provider, model, tokens, latency, surface) so this page shows ACTUAL spend, not projections.
Until then, the spend figures above are projections from list pricing × your assumptions — no fabricated usage. The canonical router already emits a structured llm.call log line per call; the sink wires those into a queryable store.