Tools

CodeBuddy

Connect CodeBuddy to the LMU AI API via models.json — enter the full /chat/completions endpoint to use Claude, GPT and Chinese models.

CodeBuddy (Tencent Cloud's coding assistant) is an AI code editor that supports a custom model list via a models.json config file. This page covers connecting it to LMU AI.


Install and sign in

  1. Download and install the build for your operating system from the official site: https://www.codebuddy.cn
  2. Sign in to your CodeBuddy account when prompted

Configure LMU AI

Step 1: Pick the config file location

LevelPathNotes
User level (recommended)~/.codebuddy/models.jsonGlobal config, applies to all projects
Project level<project-root>/.codebuddy/models.jsonProject-specific, takes priority over user level

Create the file if it doesn't exist. Merge order from highest to lowest: project level → user level → built-in defaults.

Step 2: Write the config

Using the user-level ~/.codebuddy/models.json as an example:

{
  "models": [
    {
      "id": "claude-opus-5",
      "name": "Claude Opus 5 (LMU AI)",
      "vendor": "LMU AI",
      "apiKey": "sk-your-lmu-ai-api-key",
      "url": "https://api.lmuai.com/v1/chat/completions",
      "maxInputTokens": 200000,
      "maxOutputTokens": 32000,
      "supportsToolCall": true,
      "supportsImages": true,
      "supportsReasoning": true
    },
    {
      "id": "gpt-5.6-sol",
      "name": "GPT-5.6 Sol (LMU AI)",
      "vendor": "LMU AI",
      "apiKey": "sk-your-lmu-ai-api-key",
      "url": "https://api.lmuai.com/v1/chat/completions",
      "maxInputTokens": 400000,
      "maxOutputTokens": 32000,
      "supportsToolCall": true
    }
  ]
}

url must be the full path, not a base URL

The url field takes the full endpoint path, ending in /chat/completions:

  • ✅ Correct: https://api.lmuai.com/v1/chat/completions
  • ❌ Wrong: https://api.lmuai.com/v1
  • ❌ Wrong: https://api.lmuai.com

This is the most common reason a copy-pasted minimal example fails — plenty of tutorials treat it as a base URL, and CodeBuddy then can't reach the endpoint.

CodeBuddy only supports the OpenAI format

The official docs state that only OpenAI-format APIs are supported at present, so connect to LMU AI over the OpenAI-compatible protocol.

Claude models work fine too: enter a model ID like claude-opus-5 directly, and the LMU AI backend handles the OpenAI ↔ Anthropic conversion.

Step 3: Pick the model and start chatting

Just save the file — models.json supports hot reload (1-second debounce), so there's no need to restart CodeBuddy. Select your newly configured model in the chat box's model picker and you're set.

Models added via models.json are automatically tagged custom, making them easy to spot in the UI.


Field reference

Fields available on each entry in the models array:

FieldTypeRequiredNotes
idstringUnique model identifier — use the LMU AI model ID
namestring-Display name in the dropdown
vendorstring-Vendor name; anything you like
apiKeystring-The sk- key generated in the LMU AI console (the actual key value, not an env var name)
urlstring-Full endpoint path; for LMU AI, https://api.lmuai.com/v1/chat/completions
maxInputTokensnumber-Maximum input tokens
maxOutputTokensnumber-Maximum output tokens
supportsToolCallboolean-Whether tool calling is supported
supportsImagesboolean-Whether image input is supported
supportsReasoningboolean-Whether reasoning mode is supported

Show only specific models

Use the top-level availableModels field to control which models appear in the dropdown:

{
  "models": [
    {
      "id": "claude-opus-5",
      "name": "Claude Opus 5 (LMU AI)",
      "apiKey": "sk-your-lmu-ai-api-key",
      "url": "https://api.lmuai.com/v1/chat/completions",
      "supportsToolCall": true
    }
  ],
  "availableModels": ["claude-opus-5"]
}
  • Omitted or an empty array → all models are shown
  • Once set → only the listed model IDs appear (built-in and custom models alike)
  • A project-level availableModels fully overrides the user-level one rather than merging

Mind the comma when removing availableModels

Per the official docs: after deleting the availableModels field, remember to remove the now-trailing , after the models array above it, or the JSON becomes invalid and the whole config stops working.


Common model IDs

Model IDNotes
claude-opus-5Claude Opus 5 (flagship, recommended)
claude-sonnet-5Claude Sonnet 5 (balanced)
claude-haiku-4-5Claude Haiku 4.5 (fast)
gpt-5.6-solGPT-5.6 Sol
glm-5.2GLM-5.2
qwen3.8-max-previewQwen 3.8 Max Preview
deepseek-v4-proDeepSeek V4 Pro
kimi-k3Kimi K3

Not sure which model to enter? Go to the Model Gallery to see every available model ID and copy it with one click.

For a 1M context window, write the model ID with the [1M] suffix (e.g. claude-opus-5[1M]) and raise maxInputTokens accordingly.


Troubleshooting

Config not taking effect?

  1. Check that the JSON is valid (a missing or trailing comma is the usual culprit)
  2. Confirm the file path is right (~/.codebuddy/models.json)
  3. Confirm every entry has the required id field
  4. Confirm the file was actually saved to disk (hot reload has a 1-second debounce)

Model missing from the dropdown?

  • If availableModels is set, check that the model ID is listed there
  • Check that the entry in the models array is complete

Getting a 401 / 404?

  • 401: is apiKey the sk- key generated in the LMU AI console?
  • 404: url is almost certainly missing /chat/completions — it must be the full path

Notes

  • url must be the full endpoint path https://api.lmuai.com/v1/chat/completions, not just /v1 or the bare domain
  • CodeBuddy supports only the OpenAI format; Claude models go through LMU AI's protocol conversion
  • apiKey takes the actual key value — env var names aren't supported
  • The config hot reloads, so saving is enough; no restart needed
  • Each model entry needs its own apiKey and url
  • Project-level config overrides user level per id, while availableModels is replaced wholesale rather than merged

Last updated:

On this page