feat: replace LLM provider with Sakana Fugu (straight swap)
From the PR description
Summary
Replaces the existing LLM provider with Sakana AI's Fugu model - a straight permanent swap, no feature flag.
Changes
backend/src/lib/llm/sakana.ts- Sakana Fugu adapter (OpenAI Chat Completions-compatible, streaming SSE)backend/src/lib/llm/{types,models,index}.ts- provider abstraction layer;completeTextand streaming route to Sakanabackend/src/routes/chat.ts- stampsprovider_metadata: { provider_name, model_name }on every assistantchat_messagesinsert (success, abort, and error paths) viaSAKANA_PROVIDER_METADATAconstantbackend/src/index.ts- startup guard: server refuses to boot withoutSAKANA_API_KEYsupabase/migrations/20260623000000_add_provider_metadata.sql- addsprovider_metadata JSONBcolumn tochat_messagesbackend/src/lib/llm/__tests__/sakana.test.ts- unit tests for the adapterbackend/.env.exampleandbackend/README.mdupdated
Deployment checklist
- Run the migration before deploying the new backend
- Set
SAKANA_API_KEYin Railway (Settings → Variables) - Optionally set
SAKANA_MODEL(defaults tofugu-ultra-20260615) - Remove any legacy
FUGU_API_KEYorLLM_PROVIDERenv vars after merge
Cost note
Sakana Fugu is priced at $5 / M input tokens and $30 / M output tokens.
Our analysis
Swap the LLM provider to Sakana AI's Fugu model — read the full analysis →
Think the analysis missed something the PR description covers?
Commits in this PR (10)
| SHA | Subject | Author | Date | |
|---|---|---|---|---|
108d290d | feat: types.ts - Provider=sakana, UserApiKeys.sakana | Julio G. Martinez-Clark | 2026-06-23 | ↗ GitHub |
f18e6ea6 | Add Fugu models and update model provider function | Julio G. Martinez-Clark | 2026-06-23 | ↗ GitHub |
1ace046e | Update index.ts | Julio G. Martinez-Clark | 2026-06-23 | ↗ GitHub |
303b65d0 | Update index.ts | Julio G. Martinez-Clark | 2026-06-23 | ↗ GitHub |
89735836 | Update .env.example | Julio G. Martinez-Clark | 2026-06-23 | ↗ GitHub |
3e3b6946 | Create README.md | Julio G. Martinez-Clark | 2026-06-23 | ↗ GitHub |
fe2ca9ed | Create sakana.ts | Julio G. Martinez-Clark | 2026-06-23 | ↗ GitHub |
f9ddb40a | Add tests for streamSakana and completeSakanaText | Julio G. Martinez-Clark | 2026-06-23 | ↗ GitHub |
45e56f21 | feat(chat): persist Sakana Fugu provider_metadata on assistant messages | Julio G. Martinez-Clark | 2026-06-23 | ↗ GitHub |
882fb97e | feat(db): add provider_metadata column to chat_messages | Julio G. Martinez-Clark | 2026-06-23 | ↗ GitHub |
This migration adds a new column 'provider_metadata' to the 'chat_messages' table to store information about the LLM provider and model used for each assistant response. | ||||
Capture this PR into my fork
Download a Markdown prompt that tells Claude how to port every
commit in this PR into your working tree. Run it via
claude -p < capture-pull-1.md from
inside the repo you want the changes in.