karotte README

The project's README from github.com/preferencemodel/karotte. As one markdown file: README.md.

Karotte 🥕

Karotte is an open-source framework for building robust RL environments, made by Preference Model.

Learn about the why and what:

Documentation: karotte.dev

Install

Karotte needs Python 3.12+ and uv. Runs go into a VM by default: Apple container on macOS, Firecracker on Linux. docker or podman work too. See Installation and Runtimes for what each needs.

uv tool install karotte

Quick start

Create an environment from the default template and run its example task:

karotte create-env my_env
cd my_env
uv sync --extra dev
uv run setup_data.py
export ANTHROPIC_API_KEY=...
uv run karotte run --task example-task --model anthropic/claude-opus-5-5

karotte run builds the image, runs the task, and writes the transcript to out/transcript.json. karotte dashboard out/ shows it. The quick start explains each step, and Writing tasks shows how to add your own.

Development

just lint
just test
just test-template default

Every merge to main is released. See Developing Karotte.

License

Karotte is under the MIT license. The templates in src/karotte/templates/ are under MIT No Attribution (MIT-0), so environments created from them need no license notice.

Third-party software in built images

Images built from the templates contain third-party software under its own licenses. They are based on Amazon Linux 2023. The language-toolchains template installs GPL and LGPL software (gcc, GnuCOBOL, GNU Prolog, Free Pascal, the libraries bundled with Julia, and others), Amazon Corretto (GPL-2.0 with the Classpath Exception) and Clojure (EPL-1.0) for the languages you enable. Mojo, off by default, has its own license terms; check them for the version you enable. If you distribute a built image, you're responsible for complying with the licenses of the software in it.

karotte (preferencemodel/karotte)

Searching Database…

这是什么?Karotte 是 Preference Model 开源的一个框架,用于构建稳健的强化学习(RL)环境,以训练对齐的 AI。
Karotte 是一个框架,还是现成的训练应用?它是一个带有命令行工具(karotte run、karotte dashboard)的 Python 框架,用来搭建、运行和查看 RL 环境和任务,而不是预训练模型或独立应用。
我怎么创建并运行第一个环境?先用默认模板创建一个环境,然后运行 karotte run 来构建镜像并执行示例任务;运行记录会写入 out/transcript.json,再用 karotte dashboard out/ 就能可视化查看。
运行 Karotte 之前需要装好什么?你需要 Python 3.12+ 和 uv;每次运行默认都在虚拟机里执行,macOS 上使用 Apple container,Linux 上使用 Firecracker,不过 docker 或 podman 也可以。
如果我把用 Karotte 构建的镜像分发出去,有什么需要注意的?构建的镜像基于 Amazon Linux 2023,可能捆绑 GPL/LGPL 的第三方软件(gcc、GnuCOBOL、GNU Prolog、Free Pascal、Amazon Corretto、Clojure,以及可选的 Mojo);如果你分发这样的镜像,需要自行遵守这些许可证的要求。
karotte dashboard 能看到什么?它把某次运行生成的记录文件可视化,让你查看任务是如何一步步执行的。
为什么每个任务都在虚拟机里运行,而不是直接在宿主机上跑?为了稳健性,Karotte 默认把运行隔离在虚拟机中(macOS 上用 Apple container,Linux 上用 Firecracker),不过也可以改用 docker 或 podman。
一个环境可以包含哪些第三方语言工具链?language-toolchains 模板可以安装 gcc、GnuCOBOL、GNU Prolog、Free Pascal、Julia 自带的库、Amazon Corretto 和 Clojure;Mojo 也可用,但默认关闭。
Karotte 更新得频繁吗?每次有代码合并到 main 分支,都会触发一个新版本发布。
What are similar projects?AirSim, dopamine, multitown, Proteus, ml-agents, Gymnasium, carla, gym
Size
1.9 MB
Stars
143
Updated
CommitOct 16
Age
1mo
Commits · 90 Days