Skip to content

How to use uncensored abliterated models with Kimi Code

A config.toml that runs Kimi Code on abliterated DeepSeek and GLM models, and the folder mistake that causes "No providers configured". Tested on Kimi Code 2.8.1.

Published Updated 4 min read

Kimi Code, Moonshot's terminal coding agent, accepts OpenAI-compatible providers in its config file, so you can run it on an uncensored, abliterated model instead of Kimi's own. We set up Kimi Code 2.8.1 against CommentLLM's abliterated DeepSeek V4.1 Flash model and gave it a real bug to fix. It fixed it and the tests passed.

The short version: in ~/.kimi-code/config.toml, add a [providers.commentllm] table with type = "openai", base_url = "https://api.commentllm.com/v1" and api_key_env = "COMMENTLLM_API_KEY", add a [models."..."] table for each model, and set default_model. The folder is ~/.kimi-code, not ~/.kimi.

How a coding agent connects to an abliterated model: the agent sends prompts to the CommentLLM API, which passes them to the model and returns its tool calls

What you need

  • Kimi Code. We used version 2.8.1, installed with npm install -g @moonshot-ai/kimi-code, which needs Node 22.19 or later. Kimi's install script works too.
  • A CommentLLM API key. Create one under Keys in the console after you sign up and add credit.

You do not need a Kimi account.

Step 1: put your key in an environment variable

export COMMENTLLM_API_KEY="cllm_..."

Step 2: write ~/.kimi-code/config.toml

default_model = "deepseek-abliterated"

[providers.commentllm]
type = "openai"
base_url = "https://api.commentllm.com/v1"
api_key_env = "COMMENTLLM_API_KEY"

[models."deepseek-abliterated"]
provider = "commentllm"
model = "deepseek-v4.1-flash-abliterated"
max_context_size = 1048576

[models."glm-abliterated"]
provider = "commentllm"
model = "glm-5.3-abliterated"
max_context_size = 1048576
Setting Why
type = "openai" Tells Kimi Code to call the OpenAI Chat Completions endpoint
api_key_env The name of the environment variable that holds the key. Use it or api_key, never both. Kimi Code does not read the variable unless it is named here
[models."alias"] The name in quotes is your alias. model is the ID sent to the API
default_model The alias Kimi Code starts with

Check it:

kimi provider list

It should print commentllm type=openai models=2 source=inline.

Step 3: start Kimi Code

Run kimi in your project. The first run in a folder asks Trust this folder? The banner still advertises Kimi's own managed model; the model in use is shown in the status line, with a 1M context window.

Kimi Code 2.8.1 starting with the deepseek-abliterated model

Step 4: give it a task

Our test project had a log-triage script with a bug: it counted failed SSH logins by username instead of by source address, so both tests failed. We asked:

The test suite fails. Run the tests, find the bug in auth_triage.py and fix it. Then run the tests again.

Kimi Code asks before commands and edits: Approve once, Approve for this session, Reject or Reject with feedback.

Kimi Code asking for approval before running a command

It ran the tests and saw 2 failed, edited one line and ran them again: 2 passed. The run took 1 minute 36 seconds, most of it us answering the prompts.

Kimi Code on DeepSeek V4.1 Flash Abliterated fixing the bug in auth_triage.py, with 2 passed

Common problems and fixes

What you see Why Fix
No providers configured. The config is in ~/.kimi/config.toml. That folder belongs to the older Python kimi-cli Move it to ~/.kimi-code/config.toml
An offer to "Migrate from kimi-cli" Kimi Code found an old ~/.kimi folder Decline if you only created it by mistake, and delete the folder
Authentication error api_key_env is missing or the variable is not set Name the variable in api_key_env and export it
A config error about the API key Both api_key and api_key_env are set Keep one
Many approval prompts The default asks each time Choose Approve for this session, or start with -y in a sandbox

Which model to use

Start with deepseek-v4.1-flash-abliterated, the model that fixed the bug here. glm-5.3-abliterated is the one to try for harder reasoning. Both take text only, so image input does not work. If the agent feels slow, switch the model ID to deepseek-v4.1-flash-abliterated-fast: it is the same model served about five times faster, at the same input and output rates and a higher cached-input rate. The pricing page lists every model and its rate.

Run it in a sandbox

Abliterated models refuse far fewer requests than standard ones, and that includes commands an agent should not run on your machine. Try it first in a throwaway project, as we did, and review what the model writes before you ship it.

Setting up a different agent? Uncensored coding AI lists every agent we tested, with a guide for each.

Questions

Can Kimi Code use uncensored or abliterated models?

Yes. Kimi Code accepts OpenAI-compatible providers in config.toml. We ran Kimi Code 2.8.1 on DeepSeek V4.1 Flash Abliterated through CommentLLM, and it fixed a failing test.

How do I add a custom provider to Kimi Code?

In ~/.kimi-code/config.toml, add a [providers.name] table with type set to openai, the API's base_url and api_key_env naming your key's environment variable. Add a [models."alias"] table with the provider, the model ID and max_context_size, then set default_model to the alias.

Why does Kimi Code say No providers configured?

Usually because the config was written to ~/.kimi/config.toml, the folder of the older kimi-cli. Kimi Code reads ~/.kimi-code/config.toml.

Do I need a Kimi account to use my own API key?

No. With a provider in config.toml, Kimi Code 2.8.1 started without a login in our test.

Start building today.

Create an account, tell us what you work on, and send your first request.