DEV Community

Mattias chaw
Mattias chaw

Posted on

How to Use DeepSeek V4 Pro in VSCode with KiloCode

How to Use DeepSeek V4 Pro in VSCode with KiloCode

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 $5 free credit on signup

Step 1: Get Your AIWave API Key

  1. 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:

Setting Value
API Base URL https://aiwave.live/v1
API Key Your AIWave API key (starts with sk-...)
Model deepseek-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"
}
Enter fullscreen mode Exit fullscreen mode

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:

Task Recommended Model Input Cost Why
Complex code generation deepseek-v4-pro $0.42/1M Best HumanEval score (92.1)
Quick completions / autocomplete deepseek-v4-flash $0.14/1M 3x cheaper, still 89.2 HumanEval
General chat / docs deepseek-chat $0.164/1M Cheap and fast for non-code tasks
Math-heavy algorithms deepseek-r1 $0.605/1M Strong reasoning, 64K context
Budget option (any task) ernie-4.0-turbo-8k $0.001/1M Ultra-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)
Enter fullscreen mode Exit fullscreen mode

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

Problem Solution
"API key invalid" Double-check your key in AIWave dashboard. Regenerate if needed.
Slow responses Switch to deepseek-v4-flash for speed, or check your internet connection to the Singapore-hosted API.
Context too long DeepSeek V4 Pro supports 1M tokens, so this rarely happens. If it does, trim your chat history.
403 errors Ensure your AIWave account has credit. New accounts get $5 free.

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.
Enter fullscreen mode Exit fullscreen mode

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


Sign up for AIWave to get started with your $5 free credit. See the full model list for all 60+ options, or join Discord to share your KiloCode setup with other developers.

Top comments (0)