Connecting to sources…

How to build Stanford Pupper v3: the whole process

102 steps to build Stanford Pupper v3, from buying parts, printing and assembly to software, calibration and training, with the bill of materials, shop links and the…

The docs put a self-build at about US$2000; the BOM sheet totals about US$2,158.91 (minimum US$1,785.91, of which 12 GIM4305 joints are about US$1,320). Present Perfection full kit US$3,400, assembled US$3,800 (2026‑10‑31, before tax and shipping)

Buy parts

  • Purchase Parts From the BOM

    When building Pupper from scratch, refer to the linked bill of materials and purchase each required part individually.

  • Buy a Pupper Kit

    Alternatively, purchase a kit listed in the document.

  • Source the Two Custom PCBs

    Sourcing the two custom PCBs individually, rather than in a kit, is a little tricky.

  • Prepare the Pupper v3 control board

    Prepare a Pupper v3 control board and a Raspberry Pi 4 running Ubuntu 22.04 with ROS2 Humble. The recommended realtime image is 22.04.1_v5.15.39-rt42-raspi_ros2_humble.

Assemble

  • Copy the CSV animation file

    Copy the csv file to ros2_ws/src/animation_controller_py/launch/animations.

Software

  • Install the required Agents SDK

    Use `livekit-agents` 1.8.12 or later for Python, or `@livekit/agents` 1.10.0 or later for Node.js. No separate plugin or extra is required.

  • Initialize the Python AgentSession

    Create an `AgentSession` with `TurnHandlingOptions` and enable `inference.TurnDetector()` as the turn detector. `AgentSession` provides the required VAD automatically.

  • Initialize the Node.js AgentSession

    Create a `voice.AgentSession` and enable `new inference.TurnDetector()` in the `turnHandling` options. The session automatically provides the required VAD.

  • Pin the Python turn detector version

    Pass `version="v1-mini"` to `inference.TurnDetector()` to select a specific model version instead of relying on automatic selection.

  • Pin the Node.js turn detector version

    Pass `{ version: 'v1-mini' }` to `new inference.TurnDetector()` to select a specific model version instead of relying on automatic selection.

  • Select the turn detector model

    Set `version` to `v1` for the full model or `v1-mini` for local CPU inference. If omitted, the model is selected automatically based on the environment.

  • Override the turn confidence threshold

    Set `unlikely_threshold` to a scalar for every language or to a dictionary keyed by language code. Languages not included in the dictionary retain the active model's calibrated default.

  • Configure local model fallback

    Set `local_fallback` to control whether the full `v1` model can fall back to the local `v1-mini` model after a LiveKit Inference failure. Its default value is `True`.

  • Use automatic conversation context

    The session automatically supplies the agent's last message and the user's current turn length to the detector. No additional configuration is needed for these inputs.

  • Select an explicit detector version

    Set the detector's `version` parameter to `"v1"` to use the full model in a self-hosted agent or pin one version across environments.

  • Provide LiveKit API credentials

    Configure the full model with the LiveKit Cloud project's API key and secret through `LIVEKIT_API_KEY` and `LIVEKIT_API_SECRET`.

  • Use compute-optimized agent hardware

    Run `v1-mini` on a compute-optimized instance such as AWS c6i or c7i. Avoid burstable AWS t3 or t4g instances, which can cause inference timeouts when CPU credits run out.

  • Log the fallback warning

    When the full `v1` model encounters a prediction timeout or a LiveKit Inference error, the detector logs one warning per session.

  • Continue the current turn

    The detector emits a default probability of `1.0` for any in-flight prediction so that the current turn is not blocked.

  • Switch to the mini model

    The detector switches from the full model to `v1-mini` for the remainder of the session.

  • Rescale the unlikely threshold

    Rescale any custom `unlikely_threshold` so it retains its relationship to the mini model's calibrated defaults.

  • Reset fallback in each session

    The fallback remains active for the lifetime of its session. Each new session starts fresh and attempts the full model again.

  • Disable automatic model fallback

    Set `local_fallback=False` in Python or `localFallback: false` in Node.js to disable the fallback.

  • Handle an unavailable mini model

    If `v1-mini` is unavailable, the detector emits the default probability for each turn and retries on the next turn. The full model is retried in each new session.

  • Install a Docker engine

    Install Docker Desktop or another Docker engine before building the Pupper OS image.

  • Update Docker

    Make sure Docker is up to date; older Docker versions will not work after upgrading MacOS.

  • Create the local environment file

    Create `.env.local` in the `pupper_image_builder` directory based on `.env.example`, and include a Github personal access token (PAT) for reliable Git LFS use.

  • Build the base PiOS image

    Run the base PiOS image build script.

  • Build the full PiOS image

    Run the full PiOS image build script.

  • Build the PiOS AI image

    Run the AI image build script.

  • Bake cloud AI keys into the image

    To use chat AI capabilities out of the box, add the relevant cloud AI keys to `.env.local`.

  • Build the full image with keys

    Run the full image build script with the `--include-keys` flag to include the cloud AI keys from `.env.local` in the image.

  • Enable automatic login

    Optionally enable the Pi to log in automatically as the `pi` user on boot by editing `/etc/gdm3/custom.conf`.

  • Blacklist DualSense controller audio

    Edit /etc/modprobe.d/blacklist.conf and add blacklist snd_usb_audio to resolve the lack of sound from the Pupper speaker on PiOS.

  • Increase Docker Desktop memory limit

    Open the resources option in Docker Desktop settings and increase the RAM memory limit; this is primarily needed when building ROS on PiOS.

  • Disable NetworkManager wait-online service

    Run the command after booting the actual RPi to disable NetworkManager-wait-online.service, which adds one minute to startup time.

  • Configure the PiOS boot command line

    Write the complete shown line into cmdline.txt. It selects HDMI-A-1 at 720x720M@60D with 270-degree rotation, sets the JP wireless regulatory domain, and runs /boot/firstrun.sh at boot with a reboot after success.

  • Create the PiOS first-run script

    Save the shown script as /boot/firstrun.sh. It sets the hostname to pupper and updates /etc/hosts, enables SSH, configures the first user as pi with the shown password hash and /home/pi, adjusts automatic-login and sudo settings, and configures the wireless SSID, password, and JP.

  • Clone repository and install dependencies

    Enter the `agent-starter-python` directory and use `uv sync` to install dependencies into a virtual environment.

  • Create the local environment file

    Copy `.env.example` to `.env.local`, then fill in the required environment variable values.

  • Set the LiveKit URL

    Set `LIVEKIT_URL` to a LiveKit Cloud address or to a LiveKit service you host yourself.

  • Set the LiveKit API key

    Enter the `LIVEKIT_API_KEY` in `.env.local`.

  • Set the LiveKit API secret

    Enter the `LIVEKIT_API_SECRET` in `.env.local`.

  • Configure the OpenAI key

    Enter `OPENAI_API_KEY` in `.env.local`, or use your preferred LLM provider.

  • Configure the Deepgram key

    Enter `DEEPGRAM_API_KEY` in `.env.local`, or use your preferred STT provider.

Calibrate and test

  • Record the default credentials

    The default hostname is `pupper`, the user is `pi`, and the password is `rhea123`.

  • Reduce first-boot wait time

    Disable `NetworkManager-wait-online.service` to reduce boot time from about 90 seconds to about 30 seconds; do not do this when using AI.

  • Pair the Bluetooth controller

    Pair a PS4 or PS5 controller over Bluetooth.

  • Connect to Wi-Fi

    Optionally connect to Wi-Fi.

  • Talk to the Agent Locally

    Start the agent console and talk to the agent locally.

  • Test with Simulated Users

    Test the agent against simulated text users.

  • Inspect Sessions for Problems

    List the agent sessions and read them to find and fix problems.

  • Customize joystick buttons

    Start the recorder with the record button set to 4 and the stop button set to 5.

  • Customize the output directory

    Start the recorder with the bag output directory set to /custom/path/bags.

  • Configure recorder parameters

    record_start_button is the joystick button index for starting recording, with a default of 6; record_stop_button is the joystick button index for stopping recording, with a default of 7. bag_output_dir is the directory for saving bag files, with a default of ~/bags.

  • Adjust camera frame rate

    The camera FPS is 10hz by default. Adjust it in ros2_ws/src/neural_controller/launch/config.yaml with the FrameDurationLimits: [100000, 100000] parameter.

  • Match animation frame rate and fade time

    If editing the animation frame rate or fade time, edit both config.yaml and pupster.yaml.

  • Configure ros2_control for realtime

    Configure ros2_control for realtime operation using the linked ros2_control Controller Manager documentation.

  • Configure the ros2_control hardware interface
  • Configure STT end-of-turn signals

    When using an STT model with built-in end-of-turn detection, the configured turn detector takes precedence by default. Set `turn_detection="stt"` only when the session should use end-of-turn signals from the STT.

  • Test configuration

    Run test_config.py to test the configuration.

Data and training

  • Start recording animation data

    Hold L1 until the BAG status icon turns green, indicating that an mcap bag recording is in progress.

  • Move Pupper through the motion

    Move Pupper through the desired motion.

  • Stop the recording

    Press R1 to stop recording.

  • Verify the animation in Foxglove

    View the recorded mcap file in Foxglove to verify the animation.

  • Store the recorded bag

    Move the recorded bag to pupperv3-monorepo/bags.

  • Convert mcap to CSV

    On the robot, run scripts/mcap_to_csv.py with the mcap path, absolute start time, and absolute end time to convert it to csv.

  • Run basic training

    Run pupper_mjx_rl_training.py for basic training.

  • Reduce training timesteps

    Set fewer training timesteps with training.ppo.num_timesteps=100000000.

  • Use a smaller network

    Use a smaller network with policy.hidden_layer_sizes=[128,64,64,64].

  • Enable height field

    Enable the height field with training.height_field_random=true.

  • Load from checkpoint

    Load from the specified checkpoint with training.checkpoint_run_number=238.

  • Inspect LiveKit session analytics

    Authenticate with `lk cloud auth --user-auth`, list sessions, and retrieve a session transcript with the `lk analytics session` commands. These commands require user authentication and read data only from sessions where agent observability is enabled for the project.

Use it

  • Speak to the agent in the terminal

    Run the command to speak to the agent directly in your terminal.

  • Run the agent for a frontend or telephony

    Use the `dev` command to run the agent for use with a frontend or telephony.

  • Start the agent in production

    In production, run the agent with the `start` command.

  • Create the Cloud Deployment

    Deploy the agent to LiveKit Cloud.

  • Deploy a New Agent Version

    Deploy each new version of the agent.

  • Filter raw image topics

    The recorder excludes topics containing image_raw, camera/image_raw, rgb/image_raw, or depth/image_raw to save storage space.

Parts

  • 12 Steadywin GIM4305 joints (4005 brushless motor with 10:1 planetary gearbox, ~3.5 Nm peak, ~1.0 Nm continuous, ~30 rad/s)
  • Raspberry Pi 5 8GB with an M.2 slot for an AI accelerator (Raspberry Pi AI Kit optional in the BOM)
  • Custom Pi HAT control board and power distribution board (JLCPCB assembly; the BNO086 must come through global sourcing)
  • 4-inch LCD for facial animations, 3W speaker, IMX296 fisheye camera, 9g ear servos
  • Two DeWalt 20V PowerStack 1.7Ah batteries, a PS5 controller
  • PETG and TPU printed structure, M2.5 heat-set inserts, squash balls as feet

Tools

  • 3D printer (PETG and TPU)
  • Soldering iron (250°C for heat-set inserts)
  • Electric screwdriver and super glue (BOM)

Skills

  • Flashing motor-driver and control-board firmware
  • Ordering PCB assembly (JLCPCB global sourcing plus PCBA)
  • ROS 2 and Linux (SSH, building the workspace)
  • Reinforcement learning and MuJoCo/MJX simulation (CS 123 course)

Software

  • pupperv3-monorepo (ROS 2 control, neural gait controller, AI agent)
  • pupperv3-mjx (MJX reinforcement-learning training)
  • pupOS Raspberry Pi images (full and AI builds)
  • Foxglove Studio visualisation

Documents