A coding assistant: choosing a model and integrating it
Qwen Coder, Kimi K2.7 Code, DeepSeek: how they differ on real code. How to plug one into your editor without going broke on autocomplete.
Yenisei team
A coding assistant: choosing a model and integrating it
A "coding assistant" is really three different tasks with different requirements: autocomplete (fast and cheap), chat about code (smart), and agentic refactoring (smart, with a large context). One model for everything is a bad idea.
The candidates
- Qwen3 Coder Next (
qwen3-coder-next) is built for code, handles Python/TS/Go very well, and is careful with types. A good balance of price and quality, fit for both autocomplete and chat. - Kimi K2.7 Code (
kimi-k2.7-code) is strong on large context: you drop in several whole files and it keeps track of the links between them. Take it for refactoring where seeing the entire module matters. - DeepSeek V4 Pro (
deepseek-pro) is the best reasoner: untangling someone else's legacy code, finding a non-obvious bug where the logic has to be inferred. More expensive, but it misses less often on hard problems.
Autocomplete: speed beats brains
For inline suggestions in the editor, latency is critical: the user expects a result within a fraction of a second. Use a fast model, a short context (the current function plus a couple of neighbors), and a low max_tokens. The Yenisei API works through chat/completions, so the code before and after the cursor goes in the message:
resp = client.chat.completions.create( model="qwen3-coder-next", messages=[ {"role": "system", "content": "Complete the code at <CURSOR>. Return only the insertion, no explanations."}, {"role": "user", "content": f"{prefix}<CURSOR>{suffix}"}, ], max_tokens=64, temperature=0.1,)Note the code after the cursor (suffix): without it the model cannot see that the code continues below and produces duplicates.
Chat about code: context and streaming
Here the user is willing to wait a couple of seconds but wants a sensible analysis. Turn on streaming so the answer starts printing right away:
stream = client.chat.completions.create( model="qwen3-coder-next", messages=[ {"role": "system", "content": "You are a code reviewer. Answer briefly, with example fixes."}, {"role": "user", "content": f"What is wrong with this function?\n\n{code}"}, ], stream=True,)for chunk in stream: print(chunk.choices[0].delta.content or "", end="")Agentic refactoring
This needs a large context and function calling: the model reads files, proposes patches, runs tests. Use Kimi K2.7 Code (context) or DeepSeek (complex logic), give it the tools read_file, write_file, run_tests, and an iteration limit.
The economics
Autocomplete fires on every keystroke: thousands of requests per day per developer. Even a cheap model produces most of the bill here, so:
- Debounce: do not send a request while the user is still typing.
- Cache by prefix: identical line beginnings repeat often.
- Keep
max_tokenssmall.
Chat and refactoring are called rarely; there is no need to save on the model there. 1 credit = 1 ₽, so the split across these three scenarios is easy to estimate in advance, and you can see where the budget leaks.
The practical takeaway
Start with Qwen Coder for chat and autocomplete: it covers 80% of the work. Bring in DeepSeek selectively, as a "dig into this hard bug" button. Kimi comes in when you grow into an agent that edits code across several files.