Skip to content

LLM API

Requires JWT with access_level: ENCHANTER.

Read LLM Config

  • Endpoint: /api/{{ API_VERSION }}/llm_config/
  • Function: Read LLM YAML configuration.
  • Method: GET
  • Shell Command:
curl -L "https://<ROBOT_IP>/rest/api/{{ API_VERSION }}/llm_config/" \
  -H "Authorization: Bearer <token>"
  • Python Command:
import requests

url = "https://<ROBOT_IP>/rest/api/{{ API_VERSION }}/llm_config/"
headers = {"Authorization": "Bearer <token>"}
resp = requests.get(url, headers=headers)
print(resp.json())

Modify LLM Config

  • Endpoint: /api/{{ API_VERSION }}/llm_config/
  • Function: Modify one key in the LLM YAML.
  • Method: PATCH
  • Shell Command:
curl -X PATCH "https://<ROBOT_IP>/rest/api/{{ API_VERSION }}/llm_config/" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"command":"max_tokens","value":512}'
  • Python Command:
import requests

url = "https://<ROBOT_IP>/rest/api/{{ API_VERSION }}/llm_config/"
headers = {"Authorization": "Bearer <token>"}
data = {"command":"max_tokens","value":512}
resp = requests.patch(url, json=data, headers=headers)
print(resp.json())