Created: 2026-06-29
This inventory started as the Codex CLI migration tracker. As of 2026-06-29, the target direction is OpenCode CLI backed by OpenRouter, with shared OpenAI-compatible client options defaulting to OpenRouter rather than Codex CLI or direct OpenAI.
Current Shared Path#
libs/shared/config/src/loader.tsnow defaults all environments toopenrouter, withOPENROUTER_MODELdefaulting todeepseek/deepseek-v4-flashwhere a model is needed.AI_USE_CODEX_CLI=trueis treated as a legacy alias for the replacementopencode-clipath.OPENROUTER_API_KEYandOPENROUTER_BASE_URLare now the default OpenAI-compatible credentials and endpoint inputs for shared chat clients.- Shared OpenRouter modality defaults live in
libs/shared/ai/src/openai-compatible/client-options.ts: text chat usesdeepseek/deepseek-v4-flash, vision chat usesgoogle/gemini-2.5-flash-lite, text embeddings useperplexity/pplx-embed-v1-0.6b, and image generation usesgoogle/gemini-3.1-flash-lite-image. libs/shared/ai/src/openai-compatible/client-options.tsstill keeps its compatibility-oriented import path, but its default runtime provider is nowopenrouter. Production OpenRouter routing requiresOPENROUTER_API_KEY. The focused package export@oshun/ai/openai-compatible/client-optionsis available for packages that need only the shared compatible-client resolver without importing the local OpenCode server wrapper.libs/shared/ai/src/providers/opencode-cli.tsnow provides a first-class OpenCode CLI provider backed byopencode runand the OpenRouterdeepseek/deepseek-v4-flashmodel by default.libs/shared/ai/src/providers/codex-cli.tsremains only as a compatibility adapter for legacy imports; it now delegates toOpenCodeCliProviderand defaults to OpenCode/OpenRouter rather thancodex exec.createOpenAICompatibleOpenCodeServerandstartOpenAICompatibleOpenCodeServerprovide the local OpenAI-compatible service wrapper backed by OpenCode CLI and OpenRouter. The oldcreateOpenAICompatibleCodexServer,startOpenAICompatibleCodexServer, andoshun-codex-openainames remain compatibility aliases.
OpenCode/OpenRouter Target Boundary#
- Text chat defaults to OpenRouter model
deepseek/deepseek-v4-flash. - OpenCode CLI should replace the Codex CLI command runner for local/CLI-backed agent flows and should use an OpenRouter key instead of an OpenAI subscription.
- Image, audio, speech, embedding, and other modality-specific flows should use
the cheapest suitable OpenRouter-backed model or remain explicitly direct only
when OpenRouter/OpenCode cannot support the modality yet. As of 2026-06-30,
the public OpenRouter model feeds list
perplexity/pplx-embed-v1-0.6bas the cheapest non-free text embedding model andgoogle/gemini-3.1-flash-lite-imageas the cheapest listed text-to-image model; stalegoogle/gemini-2.5-flash-image-preview[:free]defaults should not be used.
Direct OpenAI/OpenAI-Compatible Call Sites#
These files matched direct OpenAI SDK imports, constructors, chat completions, responses, image, audio, or embedding calls:
apps/oshun/bff/src/sophia/answer-synthesizer-env.tsandapps/oshun/bff/src/sophia/answer-synthesizer.ts(migrated optional Sophia synthesis chat enhancement to the shared OpenRouter/OpenCode-compatible resolver; legacyOSHUN_LLM_*triples remain explicit overrides)apps/oshun/bff/src/assistant/llm-reply-composer.ts(migrated optional assistant reply composition chat enhancement to the same shared OpenRouter/OpenCode-compatible resolver; legacyOSHUN_LLM_*triples remain explicit overrides)apps/oshun/bff/src/accessibility/ml-accessibility-service.ts(migrated default visual alt-text chat model todeepseek/deepseek-v4-flash; the Whisper-compatible transcription branch remains explicit direct audio modality)apps/lilith/svc-ai/src/conversation-generation/conversation-generation-service.ts(migrated logical OpenAI-compatible conversation turns to shared OpenRouter credentials, endpoint, anddeepseek/deepseek-v4-flashdefault model)apps/lilith/svc-ai/src/llm-orchestration.ts(migrated the OpenAI provider adapter to shared OpenRouter-compatible credentials, endpoint, anddeepseek/deepseek-v4-flashdefault model; Azure OpenAI remains explicit)apps/lakshmi/worker/src/index.ts(no runtime provider call; contains only a future embeddings placeholder comment)services/metis/src/metis/services/tutoring_service.py(migrated the tutoring OpenAI-compatible chat branch to OpenRouter/OpenCode-compatible credentials, endpoint, anddeepseek/deepseek-v4-flashdefault model; explicit OpenAI remains opt-in)services/psyche/knowledge-base/src/knowledge_base/rag/generator.py(migrated RAG OpenAI-compatible chat and streaming generation to OpenRouter/OpenCode-compatible credentials, endpoint, anddeepseek/deepseek-v4-flashdefault model; explicit OpenAI remains opt-in)services/psyche/voice-engine/src/voice_engine/conversation/llm.py(migrated voice conversation OpenAI-compatible chat and streaming generation to OpenRouter/OpenCode-compatible credentials, endpoint, anddeepseek/deepseek-v4-flashdefault model; explicit OpenAI remains opt-in)apps/veritas/api/src/interfaces/http/routes/v1/writingAssistant.ts(migrated OpenAI-compatible writing provider branch to shared OpenRouter credentials, endpoint, anddeepseek/deepseek-v4-flashdefault model; Anthropic remains explicitly direct)apps/veritas/agents/src/core/llm-client.ts(migrated OpenAI provider client factory and default agent LLM configs to@oshun/ai/openai-compatible; production now requiresOPENROUTER_API_KEY)apps/veritas/ai-workers/src/workers/base/llm.ts(migrated chat client factory to@oshun/ai/openai-compatible)apps/veritas/nlp/src/services/claims/llm.ts(migrated chat client factory to@oshun/ai/openai-compatible)apps/veritas/nlp/src/services/summarization/abstractive.ts(migrated chat client factory to@oshun/ai/openai-compatible)apps/veritas/nlp/src/services/embeddings/openai.ts(left direct: embeddings are outside the current shared OpenRouter chat migration)apps/veritas/video/src/providers/whisper.tsapps/veritas/video/src/providers/whisper.spec.tsapps/yemaya/api/src/services/agent-runtime.ts(migrated logical OpenAI agent completion registration to OpenRouter/OpenCode-compatible configuration anddeepseek/deepseek-v4-flashdefault model; explicit OpenAI remains opt-in)libs/veritas/agents-core/src/llm.ts(migrated logical OpenAI-compatible agent completions to OpenRouter/OpenCode-compatible credentials, endpoint, anddeepseek/deepseek-v4-flashdefault model; explicit OpenAI remains opt-in)libs/aphrodite/stream-content-analysis/src/stream-analyzer.ts(migrated OpenAI-compatible vision chat analysis to shared OpenRouter credentials, endpoint, anddeepseek/deepseek-v4-flashdefault model)libs/aphrodite/content-tagging/src/category-detector.ts(migrated OpenAI-compatible visual category classification chat requests to the shared OpenRouter-compatible client options anddeepseek/deepseek-v4-flashdefault model)libs/contracts/src/tts/providers/openai-adapter.tslibs/hathor/llm-npc/src/platforms/llm-client.ts(migrated the OpenAI logical provider branch to shared OpenRouter credentials, endpoint, anddeepseek/deepseek-v4-flashdefault model)libs/iris/conversation-providers-openai/src/openai-provider.ts(migrated default OpenAI-compatible client factory and chat model to shared OpenRouter-compatible options; embeddings/moderation retain their explicit request models)libs/iris/conversation-providers-openai/src/openai-provider.test.tslibs/iris/multimodal/vision/video/src/video-analyzer.tslibs/isis/ai-providers/src/providers/conversational-ai/llm-adapters/gpt51-adapter.ts(migrated OpenAI-compatible client factory and default cost-tier model to@oshun/ai/openai-compatible/deepseek/deepseek-v4-flash)libs/isis/ai-providers/src/providers/conversational-ai/llm-adapters/gpt51-adapter.js(kept committed JS mirror aligned with the migrated TypeScript adapter)libs/isis/ai-providers/src/providers/llm/openai.ts(migrated OpenAI LLM provider client factory to@oshun/ai/openai-compatible)libs/isis/ai-providers/src/providers/llm/openai.js(kept committed JS mirror aligned with the migrated TypeScript provider)libs/isis/ai-providers/src/providers/llm/xai.ts(migrated xAI compatibility provider client factory and default chat model to shared OpenRouter-compatible options)libs/isis/ai-providers/src/providers/llm/xai.js(kept committed JS mirror aligned with the migrated TypeScript provider)libs/psyche/database/src/psyche_database/vector/embeddings.pylibs/psyche/memory-archival/src/embeddings.tslibs/shared/ai/src/providers/opencode-cli.ts(added OpenCode CLI provider using OpenRouter defaults)libs/shared/ai/src/providers/codex-cli.ts(legacy compatibility adapter now delegates to OpenCode CLI/OpenRouter instead of spawning Codex)libs/shared/ai/src/providers/openai.ts(migrated OpenAI LLM provider client factory to OpenRouter through@oshun/ai/openai-compatible; production requiresOPENROUTER_API_KEY)libs/shared/ai/src/providers/xai.ts(migrated xAI compatibility provider client factory and default chat model to shared OpenRouter-compatible options)libs/veritas/live-stream/src/interactive/ai-response-generator.ts(migrated OpenAI-compatible viewer-response generation to shared OpenRouter credentials, endpoint, anddeepseek/deepseek-v4-flashdefault model)libs/veritas/live-stream/src/interactive/ai-moderation.ts(migrated OpenAI-compatible Q&A moderation to shared OpenRouter credentials, endpoint, anddeepseek/deepseek-v4-flashdefault model)libs/veritas/developer-support/src/chatbot.ts(migrated OpenAI chat client factory to@oshun/ai/openai-compatible; production now requiresOPENROUTER_API_KEY)libs/veritas/llm/src/client.ts(migrated OpenAI client factory and default balanced/budget routing to@oshun/ai/openai-compatible; Anthropic remains explicit quality-first and fallback)libs/veritas/nlp-core/src/providers/openai.ts(migrated abstractive summarization chat client factory to@oshun/ai/openai-compatible; embeddings remain direct OpenAI because they are outside the current shared OpenRouter chat migration)services/metis/src/metis/services/tutoring_service.pyservices/psyche/conferencing/src/video_conferencing/perception/behavior_analysis.pyservices/psyche/knowledge-base/src/knowledge_base/embedding/generators.pyservices/psyche/knowledge-base/src/knowledge_base/rag/generator.pyservices/psyche/orchestrator/src/orchestrator/caching/embedding_service.pyservices/psyche/perception-engine/src/perception_engine/intent/behavioral.pyservices/psyche/video-conferencing/src/video_conferencing/perception/behavior_analysis.pyservices/psyche/voice-engine/src/voice_engine/conversation/llm.py
Next Migration Order#
- Route remaining TypeScript chat/vision call sites through the shared OpenRouter-compatible options or service boundary.
- Pick the cheapest suitable OpenRouter model per unsupported modality and keep any direct non-OpenRouter adapter explicitly documented until migrated.
- Update Python/service call sites to use the same shared OpenRouter service contract where feasible.