GPT to create experiment profiles

I’ve been playing with a custom GPT to create experiment profiles for the Pioreactor. Check this out:

Try asking it something like:

Create a profile that starts stirring immediately in all Pioreactors, then changes the RPM to 400 after 5 minutes, and another 50 RPM every 5 minutes after that, for 1 hour in total. Then stop stirring.

Here’s my chat log … and it works!

It’s often wrong about what options are available for a job, but that’s something I can fix once I upload some more data to it about options.

3 Likes

Nice, would you embed this in the web interface so we don’t even need to copy & paste the output?

Ooh I didn’t realize one needs chatgpt plus to use this =(

I decided to check it out. I tried using this prompt:

Create a profile. At start, stirring, temperature, and dosing will start. Start temperature is 35 C for all bioreactors. After 24 hours, the temperature in pio-dev-00 will increase by 2 C every two hours until it reaches a maximum of 50 C, after which the temperature stays constant. After 24 hours, the temperature in pio-dev-01 will increase by 1 C every two hours until it reaches a maximum of 50 C, after which the temperature stays constant. After 24 hours, the temperature in pio-dev-02 will increase by 4 C every four hours until it reaches a maximum of 50 C, after which the temperature stays constant.

And I got this:

experiment_profile_name: multi_bioreactor_temperature_ramp

metadata:
  author: realPeteDavidson
  description: This profile starts with stirring, temperature control, and dosing. After 24 hours, temperature increases at different rates for pio-dev-00, pio-dev-01, and pio-dev-02 until a maximum of 50°C is reached.

common:
  stirring:
    actions:
      - type: start
        hours_elapsed: 0.0
  temperature_control:
    actions:
      - type: start
        hours_elapsed: 0.0
        options:
          automation_name: thermostat
          target_temperature: 35
  dosing:
    actions:
      - type: start
        hours_elapsed: 0.0

pioreactors:
  pio-dev-00:
    jobs:
      temperature_control:
        actions:
          - type: update
            hours_elapsed: 24.0
            options:
              target_temperature: 37
          - type: update
            hours_elapsed: 26.0
            options:
              target_temperature: 39
          # Repeat this pattern until reaching 50°C
          - type: update
            hours_elapsed: 46.0
            options:
              target_temperature: 50

  pio-dev-01:
    jobs:
      temperature_control:
        actions:
          - type: update
            hours_elapsed: 24.0
            options:
              target_temperature: 36
          - type: update
            hours_elapsed: 26.0
            options:
              target_temperature: 37
          # Repeat this pattern until reaching 50°C
          - type: update
            hours_elapsed: 50.0
            options:
              target_temperature: 50

  pio-dev-02:
    jobs:
      temperature_control:
        actions:
          - type: update
            hours_elapsed: 24.0
            options:
              target_temperature: 39
          - type: update
            hours_elapsed: 28.0
            options:
              target_temperature: 43
          # Repeat this pattern until reaching 50°C
          - type: update
            hours_elapsed: 44.0
            options:
              target_temperature: 50

It’s nice having it create the structure and formatting.

Edit: added code block

# Repeat this pattern until reaching 50°C

sigh haha

I tried this prompt, and had to beg to explicitly get the GPT to write them all out. I’ve made some changes to the GPT to hopefully help.

This is a very good example prompt + profile output, so I’ve included the pair in the GPT, too.


FYI I did find a bug in our profile verify code, so you pio update app -b develop to get the fix if you encounter a ValueError: Update automations, not controllers error. EDIT: corrected

I’m receiving the ValueError and tried updating using “pio update -b develop”.

I’m receiving this error (in the SSH terminal):

Usage: pio update [OPTIONS] COMMAND [ARGS]…
Try ‘pio update --help’ for help.
Error: No such option: -b

Also, if I’m running 3 leader_worker images on the cluster, should I be running: (1) “pio update -b develop” on the leader only; (2) “pio update -b develop” on each leader and follower in the cluster; or (3) “pios update -b develop” on the leader?

edit: I figured it out, it’s actually “pio update app -b develop”. I updated it via the *.local/updates GUI page, but I am still curious about the second question I had (pio vs pics).

edit2: I’m still getting that error after updating to the develop version. I’m running on the “Preview Profile” mode.

When I run your example, it works without issue:

experiment_profile_name: demo_stirring_example

metadata:
  author: Cam Davidson-Pilon
  description: A simple profile to start stirring in your Pioreactor(s), update RPM at 90 seconds, and turn off after 180 seconds.

common:
  stirring:
    actions:
      - type: start
        hours_elapsed: 0.0
        options:
          target_rpm: 400.0
      - type: update
        hours_elapsed: 0.025
        options:
          target_rpm: 800.0
      - type: stop
        hours_elapsed: 0.05

This runs in “Preview Profile” without issue.

This second code gives me the red error:

experiment_profile_name: multi_bioreactor_temperature_ramp

metadata:
  author: realPeteDavidson
  description: This profile starts with stirring, temperature control, and dosing. After 24 hours, temperature increases at different rates for pio-dev-00, pio-dev-01, and pio-dev-02 until a maximum of 50°C is reached.

common:
  stirring:
    actions:
      - type: start
        hours_elapsed: 0.0
  temperature_control:
    actions:
      - type: start
        hours_elapsed: 0.0
        options:
          automation_name: thermostat
          target_temperature: 35
  dosing:
    actions:
      - type: start
        hours_elapsed: 0.0

pioreactors:
  pio-dev-00:
    jobs:
      temperature_control:
        actions:
          - type: update
            hours_elapsed: 24.0
            options:
              target_temperature: 37
          - type: update
            hours_elapsed: 26.0
            options:
              target_temperature: 39
          # Repeat this pattern until reaching 50°C
          - type: update
            hours_elapsed: 46.0
            options:
              target_temperature: 50

  pio-dev-01:
    jobs:
      temperature_control:
        actions:
          - type: update
            hours_elapsed: 24.0
            options:
              target_temperature: 36
          - type: update
            hours_elapsed: 26.0
            options:
              target_temperature: 37
          # Repeat this pattern until reaching 50°C
          - type: update
            hours_elapsed: 50.0
            options:
              target_temperature: 50

  pio-dev-02:
    jobs:
      temperature_control:
        actions:
          - type: update
            hours_elapsed: 24.0
            options:
              target_temperature: 39
          - type: update
            hours_elapsed: 28.0
            options:
              target_temperature: 43
          # Repeat this pattern until reaching 50°C
          - type: update
            hours_elapsed: 44.0
            options:
              target_temperature: 50

Running this code in “Preview Profile” gives me the following error: “Update automations, not controllers, with settings.”

pios update -b develop is syntactical-sugar for running pio update -b develop on all the workers (which in your case, includes your leader since it doubles as a worker). This is generally true: pios x runs pio x on all the workers.

In this case, since the profile logic runs only on the leader, you only need to update the leader, so pio update app -b develop is sufficient.

BTW the profile you posted above does have some valid errors, so I would suggest trying the GPT again. Basically it should look something like this.

Thanks. I’ll check out the other examples you’ve uploaded as well and play around with them.

Very cool. Would also be great if the GPT Agent instructions and example files provided to it was documented in GitHub somewhere.

Example repo that does that:
GitHub - ruvnet/gpts: A collection of the GPTs created by rUv

That’s a good idea. The provided example files are available in GitHub - Pioreactor/experiment_profile_examples - no obvious way to keep them synced between GH and OpenAI though.

1 Like

I forgot completely about this thread when I was having today’s disasters with Bard & Bing AI. I presume it currently only produces experiment profiles, but is there a way to teach it to write automations, etc?

Coming soon! We need more examples like the scheduled relay one!

1 Like