docs: comprehensive GenVM configuration guide#389
Conversation
✅ Deploy Preview for genlayer-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 17 minutes and 34 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughReplaced the LLM-only GenVM validator configuration page with a comprehensive end-to-end guide covering LLM providers, a web module, Hot-Reload via GenVM manager API, three consolidated config files (llm/web/manager), a backends-driven capability model, Lua scripting API and strategy requirements, provider examples, and updated troubleshooting. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Client as Client
participant Manager as GenVM Manager
participant Lua as Lua Strategy
participant Backend as Backend Provider
participant Web as Web Module
Client->>Manager: submit validation request (prompt, metadata)
Manager->>Lua: invoke strategy (choose model, filter input)
Lua->>Manager: selected backend id + params
Manager->>Backend: forward request (model, params, input)
Backend-->>Manager: response (json/image/text)
Manager->>Web: deliver web-module output (if web module configured)
Manager-->>Client: aggregated response (result, diagnostics)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Rewrites the GenVM configuration page with: - Full explanation of YAML + Lua config system - All 4 provider types (ollama, openai-compatible, anthropic, google) - Step-by-step Ollama local setup example - OpenRouter aggregator example - Complete Lua scripting API reference (15 core + LLM + web functions) - Provider selection strategies (default, greybox, custom) - Equivalence Principle prompt template docs - Web module configuration (URL restrictions, webdriver) - Hot-reload and troubleshooting
31a8766 to
2764f0c
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@pages/validators/genvm-configuration.mdx`:
- Around line 85-93: The current example uses webdriver_host:
http://127.0.0.1:4444 which is correct for local launches but breaks Docker
Compose setups; update the docs around the webdriver_host example to add a short
Docker-specific callout explaining that Docker Compose users should set
webdriver_host to the Selenium service hostname (e.g.,
http://webdriver-container:4444) instead of 127.0.0.1, and mention the same
guidance near the session_create_request example so Docker users know to use the
container host when using a selenium service.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 317de17d-5895-4448-b7c0-d0d16f585656
📒 Files selected for processing (1)
pages/validators/genvm-configuration.mdx
| webdriver_host: http://127.0.0.1:4444 | ||
|
|
||
| ## genvm-manager.yaml | ||
| # Browser session configuration (Firefox headless) | ||
| session_create_request: '{"capabilities":{"alwaysMatch":{"moz:firefoxOptions":{"args":["-headless"]}}}}' | ||
|
|
||
| This is the configuration of the GenVM manager. You should not need to modify this. However, if you are running the node on | ||
| macos (natively), you may want to set `permits` to some large value, as auto-detection is not supported there yet, such as `32`. | ||
| # URL access control | ||
| extra_tld: [] # Additional TLDs to allow beyond defaults | ||
| always_allow_hosts: [] # Hosts that bypass all URL restrictions | ||
| ``` |
There was a problem hiding this comment.
Add a Docker-specific webdriver_host note to prevent broken web module setups.
Line 85 uses http://127.0.0.1:4444, which is correct for local/binary setups, but Docker Compose users typically need the Selenium service hostname (e.g., http://webdriver-container:4444). Please add a short note/callout in this section to avoid a common misconfiguration path.
Suggested doc patch
# Selenium webdriver endpoint for rendering pages
webdriver_host: http://127.0.0.1:4444
+
+# Docker Compose note:
+# If running in Docker, use the webdriver service hostname instead, e.g.
+# webdriver_host: http://webdriver-container:4444Based on learnings: In pages/validators/setup-guide.mdx, docker-compose setup requires a docker-specific web config using http://webdriver-container:4444 instead of localhost.
Also applies to: 390-407
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@pages/validators/genvm-configuration.mdx` around lines 85 - 93, The current
example uses webdriver_host: http://127.0.0.1:4444 which is correct for local
launches but breaks Docker Compose setups; update the docs around the
webdriver_host example to add a short Docker-specific callout explaining that
Docker Compose users should set webdriver_host to the Selenium service hostname
(e.g., http://webdriver-container:4444) instead of 127.0.0.1, and mention the
same guidance near the session_create_request example so Docker users know to
use the container host when using a selenium service.
… top, cost management note
…ive, not validator's
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@pages/validators/genvm-configuration.mdx`:
- Around line 327-333: The table mixes qualified and unqualified Lua API
symbols; make all names fully qualified with the lib.rs. prefix for consistency
and copy-paste reliability: change base64_decode → lib.rs.base64_decode and
random_float → lib.rs.random_float (also verify other entries like
random_bytes/sleep_seconds/url_encode/etc. already use lib.rs. and update if any
are unqualified), keeping the same descriptions.
- Around line 32-39: The example restarts the LLM module but the second curl
uses module_type "Web" so it restarts the wrong module; update the POST payload
in the second call to use "module_type": "Llm" (leave "config": null as-is) so
both stop and start target the same Llm module in the Hot-Reload example,
ensuring the pair of commands consistently reference "Llm".
- Around line 235-237: The cp command uses a potentially incorrect source
filename genvm-modules-llm-release.yaml (note plural "modules") which may not
match the actual file used elsewhere (genvm-module-llm.yaml); verify the
repository and sample files for the correct release filename and update the cp
source to the correct name (or add a fallback/check) so that the block using
VERSION and the cp command copies the actual existing release file instead of
failing. Ensure references to genvm-modules-llm-release.yaml,
genvm-module-llm-release.yaml, and genvm-module-llm.yaml are reconciled and the
correct filename is used consistently.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 7d14cdd1-4250-4ce4-9864-855fffc65858
📒 Files selected for processing (1)
pages/validators/genvm-configuration.mdx
| # Restart LLM module (reloads Lua script + YAML config) | ||
| curl -X POST "http://127.0.0.1:${PORT}/module/stop" \ | ||
| -H 'Content-Type: application/json' \ | ||
| -d '{"module_type": "Llm"}' | ||
|
|
||
| However, from here you can: | ||
| - turn on and off various LLMs by setting the `enabled` field to `false`: By default they all come enabled for you to use. You will get warnings in the logs for each one that's enabled and not configured. Disabling non used LLM providers will hide those warnings | ||
| curl -X POST "http://127.0.0.1:${PORT}/module/start" \ | ||
| -H 'Content-Type: application/json' \ | ||
| -d '{"module_type": "Web", "config": null}' |
There was a problem hiding this comment.
Fix module type mismatch in Hot-Reload example.
Line 32 says you are reloading the LLM module, but Line 39 starts "Web". This will restart the wrong module.
Suggested patch
curl -X POST "http://127.0.0.1:${PORT}/module/start" \
-H 'Content-Type: application/json' \
- -d '{"module_type": "Web", "config": null}'
+ -d '{"module_type": "Llm", "config": null}'📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Restart LLM module (reloads Lua script + YAML config) | |
| curl -X POST "http://127.0.0.1:${PORT}/module/stop" \ | |
| -H 'Content-Type: application/json' \ | |
| -d '{"module_type": "Llm"}' | |
| However, from here you can: | |
| - turn on and off various LLMs by setting the `enabled` field to `false`: By default they all come enabled for you to use. You will get warnings in the logs for each one that's enabled and not configured. Disabling non used LLM providers will hide those warnings | |
| curl -X POST "http://127.0.0.1:${PORT}/module/start" \ | |
| -H 'Content-Type: application/json' \ | |
| -d '{"module_type": "Web", "config": null}' | |
| # Restart LLM module (reloads Lua script + YAML config) | |
| curl -X POST "http://127.0.0.1:${PORT}/module/stop" \ | |
| -H 'Content-Type: application/json' \ | |
| -d '{"module_type": "Llm"}' | |
| curl -X POST "http://127.0.0.1:${PORT}/module/start" \ | |
| -H 'Content-Type: application/json' \ | |
| -d '{"module_type": "Llm", "config": null}' |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@pages/validators/genvm-configuration.mdx` around lines 32 - 39, The example
restarts the LLM module but the second curl uses module_type "Web" so it
restarts the wrong module; update the POST payload in the second call to use
"module_type": "Llm" (leave "config": null as-is) so both stop and start target
the same Llm module in the Hot-Reload example, ensuring the pair of commands
consistently reference "Llm".
| VERSION=$(readlink /opt/genlayer-node/bin | sed 's|/bin||; s|.*/||') | ||
| cp /opt/genlayer-node/${VERSION}/third_party/genvm/config/genvm-modules-llm-release.yaml \ | ||
| /opt/genlayer-node/${VERSION}/third_party/genvm/config/genvm-module-llm.yaml |
There was a problem hiding this comment.
Verify release config filename before publishing this copy command.
Line 236 uses genvm-modules-llm-release.yaml (plural modules), which may be a typo relative to genvm-module-llm.yaml naming used elsewhere. If wrong, the command fails for users.
#!/bin/bash
# Verify naming consistency in docs and locate both variants.
rg -n "genvm-modules-llm-release\.yaml|genvm-module-llm-release\.yaml|genvm-module-llm\.yaml" pages -S
# If the repo includes sample config files, check which filename actually exists.
fd -i "genvm*llm*release*.yaml"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@pages/validators/genvm-configuration.mdx` around lines 235 - 237, The cp
command uses a potentially incorrect source filename
genvm-modules-llm-release.yaml (note plural "modules") which may not match the
actual file used elsewhere (genvm-module-llm.yaml); verify the repository and
sample files for the correct release filename and update the cp source to the
correct name (or add a fallback/check) so that the block using VERSION and the
cp command copies the actual existing release file instead of failing. Ensure
references to genvm-modules-llm-release.yaml, genvm-module-llm-release.yaml, and
genvm-module-llm.yaml are reconciled and the correct filename is used
consistently.
| | `lib.rs.base64_encode(data)` / `base64_decode(data)` | Base64 encode/decode | | ||
| | `lib.rs.filter_text(text, filters)` | Text filters: `"NFC"`, `"NFKC"`, `"NormalizeWS"`, `"RmZeroWidth"` | | ||
| | `lib.rs.filter_image(bytes, filters)` | Image filters: `{Denoise=0.5}`, `{JPEG=0.9}`, `{GuassianNoise=0.1}`, `{Unsharpen={0.5, 0.5}}` | | ||
| | `lib.rs.split_url(url)` | Parse URL → `{schema, host, port}` | | ||
| | `lib.rs.url_encode(text)` | URL-encode text | | ||
| | `lib.rs.sleep_seconds(n)` | Async sleep | | ||
| | `lib.rs.random_bytes(n)` / `random_float()` | Random data generation | |
There was a problem hiding this comment.
Keep Lua API symbols fully qualified for consistency.
Lines 327 and 333 list mixed qualified/unqualified names (base64_decode, random_float). Use lib.rs. prefix consistently to avoid ambiguity in copy-paste usage.
Suggested patch
-| `lib.rs.base64_encode(data)` / `base64_decode(data)` | Base64 encode/decode |
+| `lib.rs.base64_encode(data)` / `lib.rs.base64_decode(data)` | Base64 encode/decode |
...
-| `lib.rs.random_bytes(n)` / `random_float()` | Random data generation |
+| `lib.rs.random_bytes(n)` / `lib.rs.random_float()` | Random data generation |📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| | `lib.rs.base64_encode(data)` / `base64_decode(data)` | Base64 encode/decode | | |
| | `lib.rs.filter_text(text, filters)` | Text filters: `"NFC"`, `"NFKC"`, `"NormalizeWS"`, `"RmZeroWidth"` | | |
| | `lib.rs.filter_image(bytes, filters)` | Image filters: `{Denoise=0.5}`, `{JPEG=0.9}`, `{GuassianNoise=0.1}`, `{Unsharpen={0.5, 0.5}}` | | |
| | `lib.rs.split_url(url)` | Parse URL → `{schema, host, port}` | | |
| | `lib.rs.url_encode(text)` | URL-encode text | | |
| | `lib.rs.sleep_seconds(n)` | Async sleep | | |
| | `lib.rs.random_bytes(n)` / `random_float()` | Random data generation | | |
| | `lib.rs.base64_encode(data)` / `lib.rs.base64_decode(data)` | Base64 encode/decode | | |
| | `lib.rs.filter_text(text, filters)` | Text filters: `"NFC"`, `"NFKC"`, `"NormalizeWS"`, `"RmZeroWidth"` | | |
| | `lib.rs.filter_image(bytes, filters)` | Image filters: `{Denoise=0.5}`, `{JPEG=0.9}`, `{GuassianNoise=0.1}`, `{Unsharpen={0.5, 0.5}}` | | |
| | `lib.rs.split_url(url)` | Parse URL → `{schema, host, port}` | | |
| | `lib.rs.url_encode(text)` | URL-encode text | | |
| | `lib.rs.sleep_seconds(n)` | Async sleep | | |
| | `lib.rs.random_bytes(n)` / `lib.rs.random_float()` | Random data generation | |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@pages/validators/genvm-configuration.mdx` around lines 327 - 333, The table
mixes qualified and unqualified Lua API symbols; make all names fully qualified
with the lib.rs. prefix for consistency and copy-paste reliability: change
base64_decode → lib.rs.base64_decode and random_float → lib.rs.random_float
(also verify other entries like random_bytes/sleep_seconds/url_encode/etc.
already use lib.rs. and update if any are unqualified), keeping the same
descriptions.
Summary
Complete rewrite of the GenVM configuration page. Was 220 lines of sparse content + greybox tutorial. Now a comprehensive guide covering the full config system.
What's new
What's preserved
Summary by CodeRabbit