Repository navigation
Expand file tree
/
Copy pathenv.example
More file actions
199 lines (186 loc) · 10.1 KB
/
Copy pathenv.example
File metadata and controls
199 lines (186 loc) · 10.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# Copy to .env. Model-backed policies, judges and the G1 service need the three REA_* provider values;
# everything else has a working default. Exported shell variables take precedence over this file.
# ---- model provider: any OpenAI-compatible Chat Completions endpoint
# Used by the framework CLI (npm run rea), chat policies, System 2 thinkers and judges, and the G1 service.
# The pre-release FAST_* names are still read, with a deprecation notice.
REA_MODEL=
REA_BASE_URL=
REA_API_KEY=
# REA_POLICY_MODE=tool
# REA_JUDGE_MODEL= # boundary judge of routed systems; defaults to REA_MODEL
# ======== Unitree G1 service (server.mjs, thinker.mjs); see docs/robots/unitree-g1.md ========
# ---- decision models (default: REA_MODEL)
# The one-token engines (prime, token) pin max_tokens=1: use a vision model that answers with one
# content token under that limit, and set a fallback only after checking it with the engine in use.
G1_PRIMARY_MODEL=
G1_FALLBACK_MODEL=
G1_PRIMARY_TIMEOUT_MS=6000
G1_FALLBACK_TIMEOUT_MS=8000
G1_MAX_OUTPUT_TOKENS=64
G1_WARM_INTERVAL_S=20
# ---- Prime Agent 0.8.0 persistent RPC harness
# PRIME_AGENT_BIN and PRIME_AGENT_CODING_AGENT_DIR default to runtime/prime-agent and
# prime-agent-config under the current deployment directory. Set them only to override that layout.
G1_PRIME_AGENT_VERSION=0.8.0
# The provider id in prime-agent-config/models.json; list your models there.
G1_PRIME_AGENT_PROVIDER=openai-compatible
G1_PRIME_AGENT_POOL_SIZE=2
G1_PRIME_WARMUP=1
# ---- service
G1_AGENT_HOST=127.0.0.1
G1_AGENT_PORT=8091
# Shared secret for every route except GET /health (Authorization: Bearer <token>). Empty keeps the
# service open, which is only acceptable when G1_AGENT_HOST is loopback; set it before binding elsewhere.
G1_AGENT_TOKEN=
# ---- decision defaults (each is overridable per request through `cfg`)
# engine: prime = official Prime Agent persistent RPC (default) | token = raw streaming baseline |
# tool = forced tool call | react = bounded ReAct (deliberate) |
# cli = Claude/Codex CLI (needs G1_CLI_ENGINES=1) | scripted = fixed tokens, no provider (offline)
G1_ENGINE=prime
G1_PROMPT_VARIANT=short
G1_SCHEMA=compact
G1_IMG_WIDTH=320
G1_JPEG_Q=40
G1_SENSE_FILTER=cartoon
G1_PROMPT_DEPTH=1
G1_IMAGE_DETAIL=low
G1_RACE=0
# ---- sensing
# worker (persistent sense_worker.py) | subprocess (g1_u2_sense.py per capture) | fixture (synthetic frames, no robot).
# Unset: G1_PERSISTENT_CAPTURE picks between the two real cameras.
# G1_SENSE=worker
# G1_FIXTURE_DEPTH=2.5,2.5,2.5;0.3,2.5,2.5 # centre,left,right metres per frame, cycled (fixture only)
# G1_ROBOT_PROFILE=g1 # g1 | libero | ./path/to/profile.mjs
# The robot's Python for the sense worker, and the Unix socket of the RealSense frame service on the robot.
G1_SENSE_PYTHON=/usr/bin/python3
G1_REALSENSE_SOCKET=/run/g1-realsense/realsense.sock
G1_CAPTURE_TIMEOUT_MS=5000
G1_PERSISTENT_CAPTURE=1
# ---- actuation. Off by default: the service previews decisions and never moves the robot. Moving it
# takes an actuator below, G1_EXECUTE_ENABLED=1 and execute/exec_mode on the request.
# actuator: none | daemon (scripts/g1/control_daemon.py) | console (an external controller's HTTP API at
# G1_CONSOLE_BASE_URL) | cerebellum (agent-vla-async Unix socket)
# | mock (always-ready robot that never moves — offline evaluation only, see eval/README.md)
G1_ACTUATOR=none
G1_PERSISTENT_CONTROL=0
G1_EXECUTE_ENABLED=0
G1_CONSOLE_BASE_URL=http://127.0.0.1:8080
G1_CONTROL_TIMEOUT_MS=8000
G1_ARM_TIMEOUT_MS=30000
G1_MAX_PULSE_S=2.0
# ---- agent-vla-async cerebellum bridge (G1_ACTUATOR=cerebellum). Tokens are re-shaped into the
# cerebellum's bounded plans (|vx| <= 0.20, |yaw| <= 0.35, pulses <= 0.60 s); the cerebellum
# re-gates every pulse itself and expires the intent if the agent stops heartbeating.
G1_CEREBELLUM_SOCKET=/run/user/1000/g1-vla-async/control.sock
G1_CEREBELLUM_POLICY_WAIT_S=3
G1_CEREBELLUM_WAIT_FOR_POLICY=0
G1_CEREBELLUM_HEARTBEAT_S=0.5
# ---- fused safety gate
# snapshot (the Livox producer's file at G1_LIDAR_SNAPSHOT) | fixture (G1_FIXTURE_LIDAR distances)
# G1_OBSTACLES=snapshot
# G1_FIXTURE_LIDAR=5,5,5 # centre,left,right metres (fixture only)
# G1_SCRIPTED_TOKENS=W # the scripted engine's sequence; the last token repeats
G1_USE_LIDAR=1
G1_LIDAR_SNAPSHOT=/run/user/1000/g1-livox/obstacles.json
G1_DEPTH_NEAR_CENTER_M=0.55
G1_DEPTH_NEAR_SIDE_M=0.35
# A request may require the lidar veto but may not switch it off (S/Q/E would have no obstacle
# sensing at all) unless the deployment allows it, for example for contact phases without a lidar.
G1_ALLOW_REQUEST_LIDAR_OFF=0
# Re-read depth from the camera when a decision is executed on an older frame (pipeline mode, inline
# escalation): one depth-only capture, no JPEG encode.
G1_GATE_LIVE_DEPTH=1
# ---- decision pipeline
G1_PIPELINE_FRESH_MAX_S=1.0
G1_PIPELINE_CONCURRENCY=2
# ---- asynchronous reviewer (advisory only, loopback only)
G1_THINKER_ENABLED=1
G1_THINKER_BASE_URL=http://127.0.0.1:8092
G1_THINKER_HOST=127.0.0.1
G1_THINKER_PORT=8092
# Reviewer model (default: REA_MODEL).
G1_THINKER_MODEL=
G1_THINKER_TIMEOUT_MS=12000
# The review tool call carries a brief and a lesson (<= 200 chars each); 160 could truncate the JSON
# and lose the correction with it.
G1_THINKER_MAX_OUTPUT_TOKENS=320
G1_THINKER_CALLBACK_URL=http://127.0.0.1:8091/internal/thinker/correction
G1_THINKER_CALLBACK_TIMEOUT_MS=3000
# The reviewer also judges the step it watched (progress / no_progress / unsafe / unclear + a lesson)
# and posts that here; it teaches memory only. Empty string = steer only, never judge.
G1_THINKER_JUDGE_URL=http://127.0.0.1:8091/internal/judge/review
# ---- brain: memory + judge + router around /v1/step. Changes what is asked and whom; never actuates.
G1_BRAIN_ENABLED=1
G1_BRAIN_STEP_BUDGET_MS=10000
# Cross-session lessons (JSONL). Empty string disables persistence (memory lives for the process only).
G1_MEMORY_PATH=runtime/memory/experience.jsonl
# Router routing memory (per-dimension engine scores, JSON). Empty string keeps it in-process only.
G1_ROUTER_MEMORY_PATH=runtime/memory/router.json
# Routing candidates: (engine harness)@(model)[:tier[:timeoutMs]], comma separated, tiers reflex|deliberate.
# Empty = the two-arm default (cheap chain on G1_PRIMARY_MODEL, escalation engine on G1_REACT_MODEL).
# Candidates on other providers, by model prefix. Gemini Flash is served from Google's
# OpenAI-compatible endpoint (https://generativelanguage.googleapis.com/v1beta/openai) as soon as a
# key is set; without it a gemini-* candidate is listed as unreachable and every call to it is a
# config_error. reasoning_effort "low" is sent by default (Gemini 3.7+ Flash rejects "none");
# G1_PROVIDERS (JSON array of {name, prefixes, baseUrl, apiKey|apiKeyEnv, extraBody}) adds or
# overrides providers, e.g. '[{"name":"gemini","extraBody":{"reasoning_effort":"none"}}]'.
# G1_GEMINI_API_KEY=
# G1_PROVIDERS=
# G1_ROUTER_CANDIDATES=token@your-fast-vision-model:reflex, token@your-second-vision-model:reflex, react@your-larger-model:deliberate:15000
# Who decides: rule (trigger rules) | model (an asynchronous router model's suggestion, when fresh) | hybrid
# (safety triggers first, then the suggestion, then the rules). The router model runs after each step,
# off the control path, with the ACRouter prompt (candidates, prices, measured latency, per-situation quality).
G1_ROUTER_MODE=rule
# Router model (default: REA_MODEL).
G1_ROUTER_MODEL=
G1_ROUTER_MODEL_TIMEOUT_MS=3000
G1_ROUTER_EXPLORE=0.05 # epsilon-greedy exploration among eligible candidates
G1_ROUTER_MIN_TRIES=1 # every candidate is tried at least this often per situation class
# CLI-backed engines for models reachable only through their official command-line clients (claude -p, codex exec).
# 5-15 s per answer: deliberate tier and asynchronous roles only, never the reflex path.
G1_CLI_ENGINES=0
# G1_CLI_CLAUDE_BIN=claude
# G1_CLI_CODEX_BIN=codex
G1_CLI_TIMEOUT_MS=60000
G1_CLI_EFFORT=low
# USD per 1M tokens overrides for cost accounting, JSON {"model": [input, output]}; defaults in src/candidates.mjs.
# G1_MODEL_PRICES={"your-fast-vision-model":[0.44,1.32]}
G1_CAPTURE_USAGE=1 # ask the provider for token counts on the streaming path (a few ms after the token)
G1_MEMORY_MAX_LESSONS=500
G1_MEMORY_RECALL_K=3
G1_MEMORY_PROMPT_MAX_CHARS=240
# Per-session episodic ring (steps kept for router signals and the deliberate prompt).
G1_EPISODIC_CAPACITY=64
# Cross-session episode store: every step of every session (JSONL); a new session on the same task is
# told how the last G1_EPISODES_RECALL_K went. Empty path disables it.
G1_EPISODES_PATH=runtime/memory/episodes.jsonl
G1_EPISODES_MAX_SESSIONS=200
G1_EPISODES_RECALL_K=2
# ACRouter shape: cheap chain (reflex engine, defaults to G1_ENGINE) -> gate/judge verify -> escalate.
# G1_ROUTER_CHEAP_CHAIN=prime
G1_ROUTER_ESCALATE_TO=react
G1_ROUTER_K=2
G1_ROUTER_COOLDOWN=2
G1_ROUTER_MAX_DELIBERATE_FRACTION=0.5
G1_ROUTER_INLINE_ESCALATE=1
# Deliberate (bounded ReAct) engine. Defaults to the fallback model when one is set, else the primary.
# G1_REACT_MODEL=
G1_REACT_MAX_ITERATIONS=2
G1_REACT_TIMEOUT_MS=8000
# ReAct step budget (max 1024). DeepSeek-style models spend 300-700 tokens on one step's thought;
# a router candidate carries its own budget through candidateCfg, so this is the default only.
G1_REACT_MAX_OUTPUT_TOKENS=160
# Reflection (Reflexion): when a step is vetoed / judged bad, or the episode oscillates, stalls or
# keeps being refused, a text-only model writes one lesson over the last few steps. Fire-and-forget,
# at most one in flight and one per G1_REFLECT_COOLDOWN steps per session. Memory only.
G1_BRAIN_REFLECT=1
# G1_REFLECT_MODEL= # defaults to the deliberate (react) model
G1_REFLECT_COOLDOWN=3
G1_REFLECT_TIMEOUT_MS=6000
G1_REFLECT_MAX_OUTPUT_TOKENS=160
# ---- egress. When the robot reaches the provider through a local proxy, let Node use it and keep the
# robot's own network out of the proxy.
# NODE_USE_ENV_PROXY=1
# HTTP_PROXY=http://127.0.0.1:3128
# HTTPS_PROXY=http://127.0.0.1:3128
# NO_PROXY=127.0.0.1,localhost