Repolode
preferencemodel

preferencemodel/karotte

An open-source Python framework for building robust RL environments that run agent tasks in isolated VMs to train aligned AI.

Stars
186
Forks
21
Open issues
9
Last commit
2 days ago

What is it?

Karotte is a framework for building reinforcement learning environments, made by Preference Model. An environment is created from a template and defines tasks that an AI model works through step by step. Each run builds an image and executes the task inside a local VM, with a transcript written to a JSON file that can be viewed in a built-in dashboard.

Runs go into a local VM by default: Apple container on macOS and Firecracker on Linux. A Modal runtime is available for running in a VM on Modal, and local Docker or Podman also work. Requires Python 3.12+ and uv. The `language-toolchains` template includes compilers and runtimes for many languages, with some GPL and LGPL components.

A typical workflow is to run `karotte create-env`, sync dependencies, set a model API key, and then call `karotte run` with a chosen model. The project is MIT-licensed, and the bundled templates use MIT-0.

Key features

  • 01Creates environments from templates, including a default template with an example task.
  • 02Runs tasks inside local VMs on macOS (Apple container) and Linux (Firecracker).
  • 03Supports Modal, Docker, and Podman as alternative runtimes.
  • 04Writes run transcripts to JSON and provides a dashboard to view them.
  • 05Includes a language-toolchains template with compilers for many programming languages.

Use cases

  • Building RL environments to evaluate or train AI models on multi-step tasks.
  • Running model-driven tasks in isolated VMs to keep execution sandboxed.
  • Comparing how different models perform on the same task and reviewing their transcripts.

Quick start

  1. 1

    Install the karotte tool with uv

    uv tool install karotte
  2. 2

    Create an environment from the default template

    karotte create-env my_env
  3. 3

    Enter the directory, sync dependencies and set up data

    cd my_env && uv sync --extra dev && uv run setup_data.py
  4. 4

    Set your Anthropic API key and run the example task

    export ANTHROPIC_API_KEY=... && uv run karotte run --task example-task --model anthropic/claude-opus-5-5

Things to know

  • Requires Python 3.12+ and uv, and a local VM runtime (Apple container on macOS or Firecracker on Linux) or Modal, docker or podman.
  • Running the example task needs an Anthropic API key.

In collections

Topics

FAQ

What is karotte?
An open-source Python framework for building robust RL environments that run agent tasks in isolated VMs to train aligned AI. Karotte is a framework for building reinforcement learning environments, made by Preference Model. An environment is created from a template and defines tasks that an AI model works through step by step. Each run builds an image and executes the task inside a local VM, with a transcript written to a JSON file that can be viewed in a built-in dashboard.
Is karotte free to use? What license does it have?
karotte is open source under the MIT license. Check the license terms before using it in commercial products.
Is karotte still maintained?
Actively maintained. The last commit to karotte was on Nov 5, 2026.
What can I use karotte for?
Building RL environments to evaluate or train AI models on multi-step tasks. Running model-driven tasks in isolated VMs to keep execution sandboxed. Comparing how different models perform on the same task and reviewing their transcripts.
How do I install karotte?
Install the karotte tool with uv: uv tool install karotte Create an environment from the default template: karotte create-env my_env Enter the directory, sync dependencies and set up data: cd my_env && uv sync --extra dev && uv run setup_data.py Set your Anthropic API key and run the example task: export ANTHROPIC_API_KEY=... && uv run karotte run --task example-task --model anthropic/claude-opus-5-5
Where can I get karotte?
The source code and installation instructions are on GitHub: https://github.com/preferencemodel/karotte

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects

Python library that scores LLM responses for likely hallucinations using uncertainty quantification, with black-box, white-box, judge and ensemble scorers.

AI & Machine Learning#hallucination-detection#uncertainty-quantification#llm-evaluation
1.2K+2 this week140PythonApache-2.0Well maintainedUpdated 25 days ago