You just trained an AI model and now you want to use it to control your robot. Let’s see how you can do that.

Disclaimer: Letting an AI control your robot carries risk. Clear the area from pets, people and objects. You are the only one responsible for any damage caused to your robot or its surroundings.

Control your robot from the phosphobot dashboard

If you finetuned a GR00T-N1-2B model and pushed it to huggingface, you can use it directly from the phosphobot dashboard.

You can fine tune the model in a single click from the dashboard. Go here to learn how.
  1. Connect your robots and your cameras to your computer. Run the phosphobot server and go to the phosphobot dashboard in your browser: http://localhost
phosphobot run
  1. Create a phospho account or log in by clicking on the Sign in button in the top right corner.
  2. (If not already done) Add your Hugging Face token in the Admin Settings tab with Write authorization. Read the full guide here.
  3. In the AI Training and Control section, enter the instruction you want to give the robot and click on Go to AI Control. Accept the disclaimer. You’ll be redirected to the AI Control page.

  1. In the Model ID, enter the name of your model on Hugging Face (example: phospho-app/YOUR_DATASET_NAME-A_RANDOM_ID). Double check the camera angles so that they match the ones you used to record the dataset.

  2. Click on Start AI Control. Please wait: the first time, starting a GPU instance and loading the model can take up to 60 seconds. Then the robot will start moving.

You can pause, resume, and stop the AI control at any time by clicking on the control buttons.

You can edit the Instruction field to change the instruction and run it again to see how the robot reacts.

Discord

Join the Discord to ask questions and share your demos!

How to control your robot in Python?

If you’re using a different model or want more fine-grained control, you can use the phosphobot python module to control your robot with an AI model.

1. Setup an inference server

First, you need to setup an inference server. This server runs on a beefy machine with a GPU that can run the AI model. It can be your own machine, a cloud server, or a dedicated server.

If you choose a remote location, chose the closest location to minimize latency.

To setup the inference server, follow the instructions in the link below:

Setup the inference server

How to setup the inference server?

2. Call your inference server from a python script

Open a terminal and run the phosphobot server.

phosphobot run

Then, create a new python file called inference.py. Inside, copy the content of an example script below.

To run the script, install the phosphobot python module. Then, run the script.

pip install phosphobot
python your_script.py

What’s next?