AI-Assisted Coding

    Serverless Inference with Cline

    This tutorial walks you through using Kimchi's Serverless Endpoints with Cline, an agentic coding tool available as a standalone CLI and as a VS Code extension. You'll configure Cline to use open-source LLMs via Kimchi, providing a cost-effective setup for AI-assisted development.

    Overview

    By the end of this tutorial, you'll be able to:

    • Authenticate Cline against Kimchi as a model provider
    • Use MiniMax M2.5 for code generation and execution tasks
    • Run Cline interactively in your terminal or headlessly in scripts and CI/CD pipelines
    📘
    Serverless Endpoints work with any OpenAI-compatible client. This tutorial covers Cline, but the same Kimchi base URL and API key work with OpenCode and other compatible tools.

    Prerequisites

    1. A Kimchi API key — Go to Kimchi → API Keys and click Create API key. Copy the key and store it securely.
    2. Node.js 20 or higher — Check your version with node --version
    3. Cline CLI installed:
    shell
    npm install -g cline
    shell
    cline version

    Step 1: Authenticate Cline with Kimchi

    Cline manages provider configuration through its auth command:

    shell
    cline auth -p openai -k YOUR_CASTAI_API_KEY -b https://llm.kimchi.dev/openai/v1 -m minimax-m2.5
    FlagValuePurpose
    -p openaiopenaiTells Cline to use the OpenAI-compatible provider type
    -kYour Kimchi API keyAuthenticates your requests to Kimchi
    -bhttps://llm.kimchi.dev/openai/v1Points Cline at Kimchi's inference endpoint
    -mminimax-m2.5Sets MiniMax M2.5 as the default model

    Step 2: Verify Your Configuration

    Confirm that Cline stored your settings correctly:

    shell
    cline config

    You should see https://llm.kimchi.dev/openai/v1 as the openAiBaseUrl and minimax-m2.5 as the model.

    Step 3: Test the Connection

    Navigate to a project directory and run a simple test:

    shell
    cd ~/your-project
    shell
    cline "What files are in this directory?"

    Once that succeeds, try a prompt that requires a real inference call:

    shell
    cline "Explain what this project does in one paragraph"

    Using Cline

    Cline operates in two modes:

    • Interactive mode — launches a full terminal interface for hands-on development sessions. Start it by running cline with no arguments.
    • Headless mode — designed for automation. Activates when you pass the -y flag, pipe input, or redirect output:

    Run a task with automatic approval (no prompts):

    shell
    cline -y "Fix all ESLint errors in src/"

    Pipe a diff for automated code review:

    shell
    git diff | cline -y "Review these changes and summarize any issues"

    Advanced: Headless CI/CD Workflows

    Cline's headless mode makes it straightforward to integrate Kimchi into automated pipelines:

    In your CI pipeline, authenticate first:

    shell
    cline auth -p openai -k $CASTAI_API_KEY -b https://llm.kimchi.dev/openai/v1 -m minimax-m2.5

    Then use Cline in headless mode:

    shell
    git diff origin/main | cline -y "Review these changes for bugs or regressions"

    IDE Integration

    If you use Cline as a VS Code extension, settings are stored in VS Code's settings.json:

    1. Open VS Code and navigate to Settings (Cmd+, on macOS)
    2. Search for Cline
    3. Set API Provider to OpenAI Compatible
    4. Set Base URL to https://llm.kimchi.dev/openai/v1
    5. Set API Key to your Kimchi API key
    6. Set Model to minimax-m2.5

    Or add directly to settings.json:

    json
    "cline.apiProvider": "openai",
    "cline.openAiBaseUrl": "https://llm.kimchi.dev/openai/v1",
    "cline.openAiApiKey": "YOUR_CASTAI_API_KEY",
    "cline.apiModelId": "minimax-m2.5"
    📘
    Settings key names may change between Cline extension versions. If the keys above don't work, check the Cline extension documentation for the current field names.