Introducing ModelTunnel AI Native Cloud: Better frontier models, faster runs, lower costs →

ModelTunnel Code

ModelTunnel Code is a minimalist AI coding assistant for the terminal. It is a single Python file with no third-party dependencies, works with any OpenAI-compatible endpoint, and is small enough to read in an afternoon and extend however you like.

Install

Requires Python 3.10 – 3.13.

curl -fsSL https://modeltunnel.ai/install/code.sh | bash

The script downloads dncode into ~/.local/bin (override with DNCODE_DIR) and makes it executable. Make sure that directory is on your PATH.

Configure

export DEEPNEXUS_API_KEY="sk-dn-..."

Optional settings:

VariableDefaultDescription
DNCODE_MODELdeepseek-v4-proModel to use
DNCODE_BASE_URLhttps://modeltunnel.ai/v1Any OpenAI-compatible base URL (defaults to https://modeltunnel.ai/v1)
DNCODE_API_KEY$DEEPNEXUS_API_KEYAPI key for the base URL

Run

cd your-project
dncode
ModelTunnel Code · deepseek-v4-pro · ~/your-project
You > add error handling to user.py
  ▸ read_file user.py
  ▸ edit_file user.py
ModelTunnel Code > Wrapped the database calls in try/except and added logging.

Run a single task non-interactively with dncode -p "find all TODO comments".

Tools

ToolDescription
read_fileRead a file, optionally a line range
write_fileCreate or overwrite a file
edit_fileReplace an exact snippet in a file
list_filesList files, respecting .gitignore-style ignores
searchSearch file contents with a regular expression
run_shellRun a shell command in the project (asks for confirmation)

Every file change and shell command is shown before it runs. Shell commands require confirmation unless you start with --yes.

Commands

CommandDescription
/model <id>Switch model mid-session
/save [name] / /load [name]Save or resume a session from ~/.dncode/sessions
/changesList files modified in this session
/compactSummarise the conversation to free up context
/clearStart a fresh conversation
/exitQuit

Long conversations are compacted automatically before they exceed the model's context window.

ModelTunnel Code · ModelTunnel