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.

AI surfaces
13
tracked across 4 apps
Cost-free
5
OCP / subscription / local
Paid (metered)
7
per-token billing
Switchable
1
runtime provider toggle
Blocked from OCP
6
4 tool-use · 2 OpenAI

OCP proxy — live probe

Reachable· 347 ms
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

OCP (free)claude-sonnet-4-6
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.

Open Command switch →
api_key
PAID · per-token
Full portfolio tools
Default. Reliable everywhere (incl. Cloud Run).
oauth
FREE · subscription
Full tools (Agent SDK)
Only where the local claude CLI is logged in — silently falls back to api_key on Cloud Run.
ocp
FREE · subscription
TEXT-ONLY · no tools
OCP can't run caller tools (verified). Brick loses inbox/property/portfolio actions.

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.

SurfaceFileMethodModelToolsStatusNote
intel
Inbox → items extractionapp/lib/extractor.tsRouter → OCPclaude-sonnet-4-6noOn OCPText extraction via canonical llm.ts. OCP primary, Anthropic failover.
Knowledge-edge extractionapp/lib/extract-edges.tsRouter → OCPclaude-sonnet-4-6noOn OCPGraph edge inference; text-only via canonical router.
AI reflections narrativeapp/lib/reflections-narrative.tsRouter → OCPclaude-sonnet-4-6noOn OCPNarrative summary via canonical router.
keystone
AIProvider fallback chainautomation/scripts/lib/ai_provider.pyOCP (free)claude-sonnet-4-6noOn OCPOCP tier-0 added 2026-05-30; falls back to paid Anthropic → Haiku → Ollama.
Agent trio loop (Kid/Gar/Ichiro)automation/agent/agent_loop.pyAnthropic (paid)claude-sonnet-4-6yesBlocked · tool-useMulti-turn MCP tool-use. OCP can't honor caller tools — stays on paid API.
command
Brick chat agentbackend/app/ai/agent_framework.pySwitchableclaude-sonnet-4-6yesSwitchableai.auth_provider: api_key (PAID + tools) | oauth (free + tools, local CLI only) | ocp (free but TEXT-ONLY — disables portfolio tools).
runner
App description suggestionslib/gallery (suggest-description)Router → OCPclaude-haiku-4-5noOn OCPText-only via canonical router.
Excel auditapp/api/excel-audit/route.tsAnthropic (paid)claude-sonnet-4-6yesBlocked · tool-useLayer-1 exception: tool-use. Cannot move to OCP.
Lease abstract extractorlib/lease-abstract-extractor.tsAnthropic (paid)claude-sonnet-4-6yesBlocked · tool-useLayer-1 exception: structured tool-use extraction.
Explore agent looplib/agent/loop.tsAnthropic (paid)claude-sonnet-4-6yesBlocked · tool-useAnthropic tool-use loop over Postgres/Box/Knowledge tools.
FS Review import planapp/api/fs-review/import/plan/route.tsOpenAI (paid)OpenAI (GPT)yesOpenAI pathOpenAI JSON-mode. Separate OpenAI bill; not a Claude/OCP path.
FS Review structured outputlib/fs-review-openai.tsOpenAI (paid)OpenAI (GPT)yesOpenAI pathOpenAI function-calling. Separate OpenAI bill.
Lease abstract CLIscripts/lease-abstract-cli.tsAnthropic (paid)claude-sonnet-4-6yesLocal CLIManual 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.

$972/mo
projected paid spend
Paid surfaceModel$/call$/mo (est.)
keystone/Agent trio loop (Kid/Gar/Ichiro)claude-sonnet-4-6$0.0270$162
command/Brick chat agentclaude-sonnet-4-6$0.0270$162
runner/Excel auditclaude-sonnet-4-6$0.0270$162
runner/Lease abstract extractorclaude-sonnet-4-6$0.0270$162
runner/Explore agent loopclaude-sonnet-4-6$0.0270$162
runner/FS Review import planOpenAI (GPT)n/a
runner/FS Review structured outputOpenAI (GPT)n/a
runner/Lease abstract CLIclaude-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

Not yet metered

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.