Add support for OpenAI Chat Completions API compatible third party providers & local models#220
Add support for OpenAI Chat Completions API compatible third party providers & local models#220nathan-t4 wants to merge 13 commits into
Conversation
|
@nathan-t4 is attempting to deploy a commit to the Adam Team on Vercel. A member of the Team first needs to authorize it. |
Greptile SummaryAdds first-class support for OpenAI Chat Completions-compatible local/third-party models (LM Studio, ollama, vllm, DeepSeek, etc.) via an optional
Confidence Score: 4/5Safe to merge after adding error logging to the loadCatalogFromDisk catch block. The one defect that breaks expected behavior is in localChatConfig.ts: when local-models.json contains invalid JSON the catch block returns [] and caches it for the server lifetime with no log output. A developer with a minor syntax error will see all local models disappear silently with no diagnostic path. All previously raised issues have been correctly addressed in this revision. src/server/localChatConfig.ts - the catch block in loadCatalogFromDisk needs a log call before returning the empty fallback. Important Files Changed
Reviews (10): Last reviewed commit: "Add supportsForcedToolChoice for third p..." | Re-trigger Greptile |
There was a problem hiding this comment.
5 issues found across 9 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
…ty providers, and additional bug fixes
…into feat/local_models
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
…into feat/local_models
Add support for local models on CADAM (e.g. hosted by LMStudio, llama.cpp, etc.), as mentioned in #120.
To add a new local model, the user adds
local-models.jsonto the base repo. Detailed instructions are in the README.mdFeatures
local-models.json, everything works as normal)to a text-only tool output APPENDED WITH a text and image user messages that includes the multi-view rendering.
For more details, see changes in
src/server/aiChat.ts."useForAux": true, instead of just the default claude haiku model.Tested with DeepSeek v4 Flash (hosted by DeepSeek) -- a pure text LLM! :

Summary by cubic
Adds first‑class support for OpenAI Chat Completions–compatible local/third‑party models (LM Studio,
ollama,llama.cpp,vllm) vialocal-models.json, surfaced in the picker through/api/local-models. Also fixes strict local VLM tool‑image handling by appending the inspection render as a follow‑up user message, routes titles/suggestions to a local aux model when available, caps model picker height, and makes local/third‑party runs free and skip token gates.New Features
local-models.json): entries supportid,name,description,baseUrl, optionalapiKey(env var name),supportsTools,supportsThinking,supportsVision,supportsForcedToolChoice,useForAux; only entries withbaseUrlare active; file is gitignored./api/local-modelsexposes picker‑safe configs (no secrets); client hookuseParametricModelsmerges local entries with cloud;useIsLocalModelremoves UI token gating for local runs; UI vision checks use the dynamic list; model pickers are scrollable with a capped height.anthropic/*,google/*stay direct; catalog ids with abaseUrlroute to a per‑target@openrouter/ai-sdk-providerclient withcompatibility: "compatible"and normalized/v1; others go via OpenRouter; per‑model API keys are resolved server‑side from.env.local.supportsVision.tool_choiceis disabled for Claude 5 and catalog models withsupportsForcedToolChoice: false(fallback: disable whensupportsThinking: true); local/third‑party models are billed at 0, skip preflight token checks, and do not consume tokens; selecting a catalog id without abaseUrlreturns a clear error.useForAuxwhen available; else fall back to Anthropic when configured.supportsForcedToolChoice, and latest‑build detection.Migration
local-models.json.exampletolocal-models.json, set each model’sid,baseUrl, and flags.apiKeyto the env var name (e.g.,DEEPSEEK_API_KEY) and add that variable to.env.local.baseUrlappear in the picker. Cloud routes remain unchanged.Written for commit cbffde4. Summary will update on new commits.