AI coding agent for machine learning tasks: create, execute, and evaluate notebooks, and improve ML models.
Project description
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mlcode_ai-0.1.5.tar.gz.
File metadata
- Download URL: mlcode_ai-0.1.5.tar.gz
- Upload date:
- Size: 507.5 kB
- Tags: Source
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34f92e45ad395ddd98b26c2dd1f034da6ce98fabb7d9a45ffab0da5151b7c6c9
|
|
| MD5 |
44ebc48d19dd7cbc7f695a5f1d377d1a
|
|
| BLAKE2b-256 |
80a0032c01e237c099dd5f17f195f1311e2c00545961f5c322233072d69b33ff
|
File details
Details for the file mlcode_ai-0.1.5-py3-none-any.whl.
File metadata
- Download URL: mlcode_ai-0.1.5-py3-none-any.whl
- Upload date:
- Size: 187.3 kB
- Tags: Python 3
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c49e3c6a32ecb586b042c1ae78b22774d7108471ae598e0f1bb8d98ec76599e7
|
|
| MD5 |
1c8893c00528cb522eda3435ca22693f
|
|
| BLAKE2b-256 |
4f4ba7b0712de46724849137b95e770d183c67755b0afd0427161fbe9dc6f953
|