mlcode
AI coding agent for machine learning tasks
Create, execute, and evaluate Jupyter notebooks, iterate on model architectures, and automate ML workflows directly from your terminal.
What is mlcode?
mlcode is an AI coding agent tailored for machine learning workflows. Operating inside your terminal or notebook workspace, it helps you:
- Create, edit, & run Jupyter notebooks for data exploration, model training, and evaluation.
- Iterate on ML models — tweak hyperparameters, benchmark metrics, and refactor training pipelines.
- Automate experiment loops — inspect stack traces, fix code errors, and log results.
- Maintain session history — durable session trees with branching, resume, and compaction.
tau_coding → tau_agent → tau_ai
tau_ai: Model provider streaming layer (OpenAI, Anthropic, OpenRouter, local models).tau_agent: Portable agent brain (messages, tools, events, session tree).tau_coding: CLI application, Textual interactive TUI, file/shell tools, and resources.
Quickstart
Installation
mlcode requires Python 3.12 or newer.
From PyPI:
# Using uv (recommended)
uv tool install mlcode-ai
# Using pip
pip install mlcode-ai
For local development:
uv run mlcode
Usage
Run mlcode from your ML project directory:
cd my-ml-project
mlcode
Then prompt mlcode in the interactive TUI:
build a baseline PyTorch model for CIFAR-10 in a notebook and evaluate accuracy
Non-interactive print mode for scripts:
mlcode -p "summarize dataset structure in data/"
mlcode --cwd /path/to/project -p "run notebook and output evaluation metrics"
Connect a Model Provider
Start mlcode and authenticate your AI provider with /login:
/login
/login openai
/model
Supported providers include OpenAI, Anthropic, OpenRouter, OpenAI Codex, Hugging Face, and local OpenAI-compatible endpoints (Ollama, vLLM, DeepSeek).
Capabilities
- Interactive TUI & Print Mode: Full terminal interface powered by Textual or non-interactive CLI.
- Coding & Execution Tools:
read,write,edit, andbashexecution. - Notebook & ML Automation: Work with scripts, notebooks, and experiment loops.
- Durable Sessions: Append-only JSONL session histories with tree branching (
/tree) and recovery. - Custom Skills & Instructions: Support for project-level instructions (
AGENTS.md) and custom skills.
License
Released under the MIT License.
Metadata
Release files for mlcode-ai 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mlcode_ai-0.1.5.tar.gz | 507.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mlcode_ai-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 694.8 kB
Release files / mlcode_ai-0.1.5.tar.gz
| Download URL | mlcode_ai-0.1.5.tar.gz |
|---|---|
| Size | 507.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
34f92e45ad395ddd98b26c2dd1f034da6ce98fabb7d9a45ffab0da5151b7c6c9
|
|
BLAKE2b-256 checksum How to use checksums |
80a0032c01e237c099dd5f17f195f1311e2c00545961f5c322233072d69b33ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / mlcode_ai-0.1.5-py3-none-any.whl
| Download URL | mlcode_ai-0.1.5-py3-none-any.whl |
|---|---|
| Size | 187.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c49e3c6a32ecb586b042c1ae78b22774d7108471ae598e0f1bb8d98ec76599e7
|
|
BLAKE2b-256 checksum How to use checksums |
4f4ba7b0712de46724849137b95e770d183c67755b0afd0427161fbe9dc6f953
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|