How to Use DeepSeek V4 Pro in VSCode with KiloCode

Jul 18 · Tutorial
AIWave Login

AIWave for Developers

KiloCode is a VSCode extension that brings AI coding assistance directly into your editor. Combined with DeepSeek V4 Pro through AIWave's API, you get a powerful coding setup at a fraction of the cost of GitHub Copilot. Here's how to set it up end-to-end.

Prerequisites

  • VSCode (latest stable)
  • KiloCode extension (install from the VSCode Marketplace)
  • AIWave API keysign up here, get $0.20 starter credit on signup
  • Step 1: Get Your AIWave API Key

  • Go to https://aiwave.live and create an account (GitHub, Discord, or email login).
  • 2. Navigate to the dashboard and generate an API key.

    3. Copy the key — you'll need it in the next step.

    Step 2: Configure KiloCode

    Open VSCode and go to Settings → Extensions → KiloCode (or search @ext kilocode in settings). Configure these fields:

    SettingValue
    API Base URLhttps://aiwave.live/v1?utm_source=dev.to&utm_medium=organic&utm_campaign=SEO_ARTICLES
    API KeyYour AIWave API key (starts with sk-...)
    Modeldeepseek-v4-pro (default)

    In VSCode's settings.json, this looks like:

    {
      "kilocode.apiBaseUrl": "https://aiwave.live/v1",
      "kilocode.apiKey": "sk-your-key-here",
      "kilocode.model": "deepseek-v4-pro"
    }

    Step 3: Verify the Connection

    Open any project in VSCode, press Ctrl+Shift+P (or Cmd+Shift+P on macOS), and run the "KiloCode: Test Connection" command. You should see a success message confirming the API is reachable.

    Step 4: Start Coding

    Once configured, KiloCode works just like any AI coding assistant:

  • Inline completions: Start typing and accept suggestions with Tab.
  • Chat panel: Open with Ctrl+Shift+P → "KiloCode: Open Chat" to ask questions about your codebase.
  • Command palette: Use "KiloCode: Explain", "KiloCode: Refactor", "KiloCode: Generate Tests" for specific tasks.
  • Model Recommendations by Task

    Not every task needs DeepSeek V4 Pro. Here's a practical guide based on current AIWave pricing:

    TaskRecommended ModelInput CostWhy
    Complex code generationdeepseek-v4-pro$1.914/1MBest HumanEval score (1.914)
    Quick completions / autocompletedeepseek-v4-flash$0.638/1M3x cheaper, still 1.914 HumanEval
    General chat / docsdeepseek-chat$0.638/1MCheap and fast for non-code tasks
    Math-heavy algorithmsdeepseek-r1$1.914/1MStrong reasoning, 128K context
    Budget option (any task)ernie-4.0-turbo-8k$0.001/1MUltra-cheap, decent quality

    Pro tip: Set KiloCode's default model to deepseek-v4-pro for quality, but create a separate profile with deepseek-v4-flash for high-volume autocomplete — it's significantly cheaper and nearly as good for short suggestions.

    Real Example: Generating a FastAPI Endpoint

    With KiloCode's chat panel open and deepseek-v4-pro selected, try:

    "Create a FastAPI endpoint that accepts a PDF upload, extracts text using pdfplumber, and returns a JSON summary with page count and word count."

    The model will generate something like this:

    from fastapi import FastAPI, UploadFile, File, HTTPException
    import pdfplumber
    import tempfile
    import os
    
    app = FastAPI()
    
    @app.post("/summarize-pdf")
    async def summarize_pdf(file: UploadFile = File(...)):
        if not file.filename.endswith(".pdf"):
            raise HTTPException(400, "Only PDF files are accepted")
    
        with tempfile.NamedTemporaryFile(delete=False, suffix=".pdf") as tmp:
            content = await file.read()
            tmp.write(content)
            tmp_path = tmp.name
    
        try:
            with pdfplumber.open(tmp_path) as pdf:
                pages = []
                total_words = 0
                for page in pdf.pages:
                    text = page.extract_text() or ""
                    pages.append(text)
                    total_words += len(text.split())
            return {
                "filename": file.filename,
                "page_count": len(pages),
                "total_words": total_words,
                "preview": pages[0][:500] if pages else ""
            }
        finally:
            os.unlink(tmp_path)

    Switch the model to deepseek-v4-flash for the same prompt and you'll get comparable output at lower cost. For complex multi-file refactors though, stick with deepseek-v4-pro.

    Troubleshooting

    ProblemSolution
    "API key invalid"Double-check your key in AIWave dashboard. Regenerate if needed.
    Slow responsesSwitch to deepseek-v4-flash for speed, or check your internet connection to the Singapore-hosted API.
    Context too longDeepSeek V4 Pro supports 1M tokens, so this rarely happens. If it does, trim your chat history.
    403 errorsEnsure your AIWave account has credit. New accounts get $0.20 starter credit.

    Switching Models at Runtime

    You can also set the model per-request by adding a comment directive in KiloCode:

    @model deepseek-v4-flash
    Explain this function briefly.

    This lets you use cheaper models for simple questions and reserve DeepSeek V4 Pro for the hard problems.

    ---

    Sign up for AIWave

    ---

    *We're a small team behind AIWave. No VC money, no big marketing budget — just a few people who believe Chinese AI models should be accessible to everyone in the world. Your API calls keep this project alive. If you find value in what we're building, stick around. It means more than you know.*