AI-Assisted Coding
Serverless Inference with OpenCode
This tutorial walks you through using Kimchi's Serverless Endpoints with OpenCode, an agentic coding tool. You'll configure OpenCode to use MiniMax 2.5 for code execution while using GLM 5 for planning, giving you a cost-effective setup for AI-assisted development.
Overview
By the end of this tutorial, you'll be able to:
- Configure OpenCode to recognize Kimchi as a model provider
- Use MiniMax 2.5 for code generation and execution tasks
- Use GLM 5 for planning and deep reasoning tasks
- Set up a multi-model workflow that uses different models for different tasks
This tutorial is intended for developers familiar with command-line tools and JSON configuration files. It assumes basic knowledge of how LLM-based coding assistants work.
Prerequisites
- A Kimchi API key — Go to Kimchi → API Keys and click Create API key. Copy the key and store it securely.
- OpenCode installed — Install from opencode.ai or run:
curl -fsSL https://opencode.ai/install | bashStep 1: Create the OpenCode Configuration File
OpenCode needs a configuration file to recognize Kimchi as a provider. Create or edit the config file at ~/.config/opencode/opencode.json. There are other, more granular options for working with OpenCode config files. You can find more details in OpenCode documentation.
mkdir -p ~/.config/opencodetouch ~/.config/opencode/opencode.jsonnano ~/.config/opencode/opencode.jsonCtrl+O, then Ctrl+X in nano).The following configuration sets up two models under one provider: GLM 5 (for planning tasks) and MiniMax 2.5 (for code execution). This lets you use GLM 5 for high-level reasoning while using MiniMax 2.5 for the actual code generation, which is more cost-effective for high-volume coding tasks.
{
"$schema": "https://opencode.ai/config.json",
"permission": {
"*": "ask"
},
"compaction": {
"auto": true,
"prune": true
},
"model": "ai-enabler/minimax-m2.5",
"mode": {
"plan": {
"model": "ai-enabler/glm-5-fp8"
},
"build": {
"model": "ai-enabler/minimax-m2.5"
}
},
"provider": {
"ai-enabler": {
"npm": "@ai-sdk/openai-compatible",
"name": "Kimchi",
"options": {
"baseURL": "https://llm.kimchi.dev/openai/v1",
"litellmProxy": true,
"apiKey": "$CASTAI_API_KEY"
},
"models": {
"minimax-m2.5": {
"name": "minimax-m2.5",
"tool_call": true,
"reasoning": false,
"limit": {
"context": 160000,
"output": 16000
}
},
"glm-5-fp8": {
"name": "glm-5-fp8",
"tool_call": true,
"reasoning": true,
"limit": {
"context": 160000,
"output": 32000
}
}
}
}
}
}Replace $CASTAI_API_KEY with the API key you created in Kimchi → API Keys.
Step 2: Verify Your Configuration
Open a terminal, navigate to a project directory, and start OpenCode:
cd ~/your-projectopencodeTry a simple prompt to verify the connection is working: What security risks can you identify in this project?
OpenCode will use GLM 5 for planning the analysis and MiniMax 2.5 for code review.
Advanced: Multi-agent Orchestration with GSD
For more complex workflows, use the Get Shit Done (GSD) framework to orchestrate multiple agents with different models assigned to each task type.
Install GSD:
npx gsd-opencodeThen update your opencode.json to include agent-specific model assignments:
{
"$schema": "https://opencode.ai/config.json",
"permission": {
"*": "ask"
},
"compaction": {
"auto": true,
"prune": true
},
"model": "ai-enabler/minimax-m2.5",
"mode": {
"plan": {
"model": "ai-enabler/glm-5-fp8"
},
"build": {
"model": "ai-enabler/minimax-m2.5"
}
},
"provider": {
"ai-enabler": {
"npm": "@ai-sdk/openai-compatible",
"name": "Kimchi",
"options": {
"baseURL": "https://llm.kimchi.dev/openai/v1",
"litellmProxy": true,
"apiKey": "$CASTAI_API_KEY"
},
"models": {
"minimax-m2.5": {
"name": "minimax-m2.5",
"tool_call": true,
"reasoning": false,
"limit": {
"context": 160000,
"output": 16000
}
},
"glm-5-fp8": {
"name": "glm-5-fp8",
"tool_call": true,
"reasoning": true,
"limit": {
"context": 160000,
"output": 32000
}
}
}
}
},
"agent": {
"gsd-planner": { "model": "ai-enabler/glm-5-fp8" },
"gsd-plan-checker": { "model": "ai-enabler/glm-5-fp8" },
"gsd-phase-researcher": { "model": "ai-enabler/glm-5-fp8" },
"gsd-roadmapper": { "model": "ai-enabler/glm-5-fp8" },
"gsd-project-researcher": { "model": "ai-enabler/glm-5-fp8" },
"gsd-research-synthesizer": { "model": "ai-enabler/glm-5-fp8" },
"gsd-codebase-mapper": { "model": "ai-enabler/glm-5-fp8" },
"gsd-executor": { "model": "ai-enabler/minimax-m2.5" },
"gsd-debugger": { "model": "ai-enabler/minimax-m2.5" },
"gsd-verifier": { "model": "ai-enabler/glm-5-fp8" },
"gsd-integration-checker": { "model": "ai-enabler/glm-5-fp8" },
"gsd-set-profile": { "model": "ai-enabler/glm-5-fp8" },
"gsd-settings": { "model": "ai-enabler/glm-5-fp8" },
"gsd-set-model": { "model": "ai-enabler/glm-5-fp8" }
}
}Replace $CASTAI_API_KEY with your own key. This configuration uses GLM 5 for planning, research, and verification tasks, while MiniMax 2.5 handles actual code execution and debugging. Reasoning-heavy tasks go to GLM 5, while high-volume code generation uses the more economical MiniMax 2.5 model.
You can also configure GSD interactively by running /gsd-settings within OpenCode.
Advanced: GSD 2.0
GSD 2.0 no longer integrates with the OpenCode TUI — it comes bundled with its own TUI via the PI harness.
Run gsd config to generate a basic configuration. Then create the following files:
.gsd/agent/models.json
{
"providers": {
"aie": {
"baseUrl": "https://llm.kimchi.dev/openai/v1",
"api": "openai-completions",
"apiKey": "$CASTAI_API_KEY",
"models": [
{
"id": "glm-5-fp8",
"name": "GLM 5 by Kimchi",
"reasoning": true,
"input": ["text"],
"contextWindow": 160000,
"maxTokens": 32000,
"cost": { "input": 1, "output": 3.2, "cacheRead": 0, "cacheWrite": 0 }
},
{
"id": "minimax-m2.5",
"name": "MiniMax M2.5 by Kimchi",
"reasoning": true,
"input": ["text"],
"contextWindow": 160000,
"maxTokens": 16000,
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
}
]
}
}
}.gsd/preferences.md
---
version: 1
models:
research: glm-5-fp8
planning: glm-5-fp8
execution: minimax-m2.5
completion: minimax-m2.5
auto_supervisor:
model: glm-5-fp8
soft_timeout_minutes: 20
idle_timeout_minutes: 10
hard_timeout_minutes: 30
token_profile: quality
budget_ceiling: 500.00
budget_enforcement: warn
git:
auto_push: false
merge_strategy: squash
isolation: branch
commit_docs: false
skill_discovery: suggest
notifications:
on_complete: false
on_milestone: true
on_attention: true
auto_visualize: true
---Replace $CASTAI_API_KEY with your own key.
Advanced: Superpowers
Superpowers is a lightweight skills-based workflow framework. Unlike GSD, it adds no extra processes or config — it's a set of prompt skills that guide your existing agent, with lower token overhead and less setup friction.
Add the plugin to your ~/.config/opencode/opencode.json alongside the existing provider config:
{
"plugin": ["superpowers@git+https://github.com/obra/superpowers.git"]
}Restart OpenCode. Verify by asking: Tell me about your superpowers
Superpowers provides skills for brainstorming, writing plans, test-driven development, parallel subagent dispatch, systematic debugging, and branch completion workflows. Skills trigger automatically based on what you're doing — no slash commands needed.