Skip to main content

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, and bash execution.
  • 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

mlcode_ai-0.1.3.tar.gz (507.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mlcode_ai-0.1.3-py3-none-any.whl (187.2 kB view details)

Uploaded Python 3

File details

Details for the file mlcode_ai-0.1.3.tar.gz.

File metadata

  • Download URL: mlcode_ai-0.1.3.tar.gz
  • Upload date:
  • Size: 507.3 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

Hashes for mlcode_ai-0.1.3.tar.gz
Algorithm Hash digest
SHA256 9f310d076fccef038ae9ee599bba8a014d409ba770096c9607fb83c7ea621515
MD5 1635dc6d9fc16b7ddd4b2933ceca6675
BLAKE2b-256 13dee22e521630b4181583476d1d24dc3d31d64c17bb7bdc5203774490200a8c

See more details on using hashes here.

File details

Details for the file mlcode_ai-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: mlcode_ai-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 187.2 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

Hashes for mlcode_ai-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 021c9a3a862a9262084c1b5677645953584687190fb4a0b5b8f29368e4650f1d
MD5 5f08123dc85214963791ba30ac685469
BLAKE2b-256 cd887ea7f45c7b4443ae946e9b0b049b8307b5bbc8547064e7fd59b43ab91dd1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page