Docs: Overview | Setup | Hardware | Data/assets | Experiments | Results | Adding benchmarks | Model providers | Safety
This page gets a new machine from a fresh clone to a runnable benchmark. Install only the target-specific toolchains you need; the smoke test and most code checks do not require all hardware.
- macOS or Linux.
- Python 3.10 or newer.
- Docker. On macOS, install Docker Desktop. On Linux, install Docker Engine and make sure
docker psworks withoutsudo. - Git and a shell with standard Unix tools.
Hardware checks run on the host, not inside Docker. The Docker sandbox is for agent-authored code execution; flashing and measurement need host USB access to devices such as CMSIS-DAP/J-Link, Nordic PPK2, ESP32 serial ports, and the MLX90640 camera bridge.
git clone https://github.com/ubicomplab/embedded-arena.git
cd embedded-arena
python3 scripts/check_python.py
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -U pip setuptools wheel
python -m pip install -e '.[providers,dev]'
cp .env.example .env
embedded-arena doctorOptional extras:
# Hardware measurements that use Nordic PPK2
python -m pip install -e '.[hardware]'
# Hugging Face download helper
python -m pip install -e '.[assets]'The default sandbox root is ~/.cache/embedded-arena/sandboxes/default. Leave EMBEDDED_ARENA_CACHE_DIR and EMBEDDED_ARENA_SANDBOX_PATH blank in .env unless you intentionally want a custom path outside the repository.
Edit .env and add keys only for the providers you plan to run:
OPENAI_API_KEY=...
GOOGLE_API_KEY=...
ANTHROPIC_API_KEY=...Then load .env in each shell before running benchmarks:
set -a; source .env; set +aLocal and scripted adapters do not need API keys; see Model providers.
This command should pass before any board-specific setup:
CLI_LLM_SCRIPT=examples/cli_smoke_gradient_flow.jsonl \
embedded-arena run configs/smoke/gradient-flow.yaml \
--llm cli/scripted \
--iterations 1 \
--output-dir outputs/smoke \
--overwriteMAX78000 compression and power experiments use Analog Devices/Maxim tooling:
- Analog Devices MSDK and MSDK user guide
- ai8x-synthesis
- ai8x-training
- Arm GNU Toolchain
- SEGGER J-Link software if your debugger uses J-Link
The setup script clones pinned ai8x sources, installs a synthesis virtual environment, clones MSDK, installs or detects arm-none-eabi-gcc, and writes paths to .env:
./scripts/setup_max78000.sh
set -a; source .env; set +aBy default, full ai8x-training Python dependencies are skipped because the synthesis smoke path does not need them and some optional pins are platform-specific. Install them when you need ai8x training/evaluation:
MAX78000_INSTALL_TRAINING_REQUIREMENTS=1 ./scripts/setup_max78000.shVerify synthesis without physical hardware:
CLI_LLM_SCRIPT=examples/cli_smoke_synthesis_max78000.jsonl \
embedded-arena run configs/smoke/synthesis-max78000.yaml \
--llm cli/scripted \
--iterations 1 \
--output-dir outputs/smoke-max78000 \
--overwriteFor power/energy HIL experiments, also install the PPK2 extra:
python -m pip install -e '.[hardware]'Then continue with MAX78000 hardware setup.
ESP32 thermal experiments use ESP-IDF for the target TinyLLaMA firmware and PlatformIO for the MLX90640 IR camera bridge:
The setup script clones ESP-IDF under .data/toolchains/esp-idf, runs Espressif's installer, detects a serial port when possible, and writes IDF_PATH, IDF_PYTHON_ENV_PATH, ESP32_PORT, and ESP32_BAUD to .env:
./scripts/setup_esp32.sh
# or choose the target port explicitly
./scripts/setup_esp32.sh --port /dev/tty.usbmodemXXXX
set -a; source .env; set +aIf an ESP-IDF download is interrupted and later submodule recovery fails, rerun:
./scripts/setup_esp32.sh --force-reinstallThis moves the partial install aside and clones a clean ESP-IDF copy.
Do not source export.sh in the same shell before running embedded-arena; the framework calls ESP-IDF's idf.py through IDF_PATH and IDF_PYTHON_ENV_PATH while keeping your project virtual environment active.
Verify the ESP-IDF install without a connected board:
IDF_PYTHON_ENV_PATH="$IDF_PYTHON_ENV_PATH" \
"$IDF_PYTHON_ENV_PATH/bin/python" "$IDF_PATH/tools/idf.py" --versionFlash the IR camera bridge once after wiring the MLX90640 sensor:
cd firmware/ir-camera
pio run -t upload
cd ../..
python scripts/test_ir_camera.pyThen continue with ESP32-S3 thermal hardware setup.
STM32N6 compression checks use ST Edge AI / STM32Cube.AI tooling:
- X-CUBE-AI / STM32Cube.AI
- STM32CubeProgrammer for flashing/on-board validation flows
- STM32CubeIDE for the ST-LINK GDB server used by some board validation paths
ST distributes X-CUBE-AI behind a signed-in download gate, so the script does not fetch it for you. Download the zip from ST, then run:
./scripts/setup_stm32ai.sh /path/to/x-cube-ai-macarm-v10.2.0.zip
set -a; source .env; set +aThe script extracts stedgeai, writes STM32AI_COMMAND, STM32AI_DIR, and STM32_TARGET to .env, and points documentation-enabled experiments at the extracted ST docs. The default target is NUCLEO-N657X0-Q / STM32N657X0H3Q, with 512-Mbit Octo-SPI Flash on the board and 4.2 MB contiguous SRAM on the MCU. Override STM32_TARGET, STM32_FLASH_BYTES, STM32_RAM_BYTES, or STM32_MEMORY_HEADROOM_FRACTION only when intentionally targeting a different board or memory budget.
Verify synthesis:
CLI_LLM_SCRIPT=examples/cli_smoke_synthesis_stm32n6.jsonl \
embedded-arena run configs/smoke/synthesis-stm32n6.yaml \
--llm cli/scripted \
--iterations 1 \
--output-dir outputs/smoke-stm32n6 \
--overwriteThe STM32 speech-to-IPA benchmark uses gated Hugging Face assets. Log in with an account that has accepted the repository terms, then download snapshots into .data/huggingface:
huggingface-cli login
./scripts/setup_huggingface_assets.sh
set -a; source .env; set +aSee Data/assets for the expected local layout.
The MAX78000 compression benchmark needs .data/coco.zip. Build it from native COCO/Ultralytics sources with:
./scripts/setup_coco_subset.pyUse --train-count, --val-count, and --test-count for a smaller local subset while testing the pipeline.
Training checks can offload candidate training to a remote GPU host while the agent and sandbox run locally. Configure these .env keys:
REMOTE_TRAIN_HOST=
REMOTE_TRAIN_PASSWORD=
REMOTE_TRAIN_ROOT=
REMOTE_TRAIN_CACHE=
REMOTE_TRAIN_PYTHON=Then prime the remote environment:
./scripts/setup_remote_training.shWhen REMOTE_TRAIN_HOST is set, the check uploads only the candidate model, reuses cached datasets on the remote host, selects a visible GPU with nvidia-smi, and returns metrics to the local run.
Before sending a PR or handing the repo to another lab, run:
python scripts/check_docs_links.py
python scripts/check_configs.py
embedded-arena doctor