managarten/apps/mana/apps/web/src/lib/modules/memoro
Till JS a33857fa39 feat(llm): add BYOK tier + 4 provider adapters (OpenAI, Anthropic, Gemini, Mistral)
Phase 1-3 of BYOK support. Introduces a 5th LLM tier 'byok' that
routes to user-provided API keys via direct browser fetches.

shared-llm additions:
- LlmTier extended with 'byok' (rank 3, between mana-server and cloud)
- ByokBackend: LlmBackend implementation that delegates key lookup
  to an app-provided resolver callback, then dispatches to the right
  provider adapter
- 4 provider adapters:
  - OpenAI (gpt-5, gpt-4o, o1 family)
  - Anthropic (Claude Opus/Sonnet/Haiku 4.6) with CORS header
  - Gemini (2.5 Pro/Flash) — REST API with different message format
  - Mistral — OpenAI-compatible, reuses shared openai-compat adapter
- Pricing table for 20+ models with USD per 1M tokens
- estimateCost() + formatCost() helpers

Keys stay device-local (IndexedDB in next phase). Browser-direct
fetches mean keys never touch Mana's server.

Updates two existing tier maps (memoro DetailView, SourceBadge) to
include the new tier.

Planning doc at docs/architecture/BYOK_PLAN.md.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 15:06:48 +02:00
..
stores feat(brain): add domain events + tools for music, storage, chat, memoro, skilltree 2026-04-13 23:07:34 +02:00
views feat(llm): add BYOK tier + 4 provider adapters (OpenAI, Anthropic, Gemini, Mistral) 2026-04-14 15:06:48 +02:00
collections.ts feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
index.ts refactor(credits): simplify credit system — remove productivity credits, guild pools, complex gift types 2026-04-10 19:08:42 +02:00
ListView.svelte feat(web): shared FloatingInputBar, migrate 7 modules 2026-04-12 16:08:03 +02:00
llm-watcher.svelte.ts feat(memoro): show title source label below the title input 2026-04-09 14:19:59 +02:00
module.config.ts fix(mana/web): commit module-registry + module.config.ts files (build-critical) 2026-04-07 19:49:58 +02:00
queries.ts fix(mana/web+packages): clear all 270 warnings to zero 2026-04-10 17:34:49 +02:00
tools.ts feat(brain): add domain events + tools for music, storage, chat, memoro, skilltree 2026-04-13 23:07:34 +02:00
types.ts refactor(mana/web): architecture cleanup — liveQuery migration, dead types, seed registry 2026-04-10 18:01:02 +02:00