Skip to content

docs: comprehensive GenVM configuration guide#389

Merged
MuncleUscles merged 8 commits intomainfrom
feat/genvm-config-docs
Apr 9, 2026
Merged

docs: comprehensive GenVM configuration guide#389
MuncleUscles merged 8 commits intomainfrom
feat/genvm-config-docs

Conversation

@MuncleUscles
Copy link
Copy Markdown
Member

@MuncleUscles MuncleUscles commented Apr 9, 2026

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

  • Explanation of YAML + Lua layered config architecture
  • All 4 provider types documented (ollama, openai-compatible, anthropic, google)
  • Step-by-step Ollama local setup — the most common validator question
  • OpenRouter aggregator example
  • Complete Lua scripting API reference (15 core functions + LLM + web)
  • Provider selection strategies: default (random), greybox (ordered), custom
  • Equivalence Principle prompt template documentation
  • Web module config (URL restrictions, webdriver, TLD allowlist)
  • Hot-reload without full restart
  • Troubleshooting section

What's preserved

  • Partner credits callout (top of page)
  • Full greybox setup and customization guide
  • All existing environment variable references

Summary by CodeRabbit

  • Documentation
    • Expanded configuration guide for multiple LLM providers and a web module; consolidated three config files with guidance.
    • Added environment-variable table and warnings when enabled backends lack keys.
    • Updated troubleshooting with generalized validation errors and resolution guidance.
  • New Features
    • Added Hot-Reload instructions for starting/stopping modules via the manager API.
    • Introduced a backends-driven capability model, provider examples (local Ollama, OpenRouter), Lua scripting API, custom strategy requirements, and prompt-template guidance.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 9, 2026

Deploy Preview for genlayer-docs ready!

Name Link
🔨 Latest commit d5021ac
🔍 Latest deploy log https://app.netlify.com/projects/genlayer-docs/deploys/69d7a83d0c9799000843d10c
😎 Deploy Preview https://deploy-preview-389--genlayer-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 9, 2026

Warning

Rate limit exceeded

@MuncleUscles has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 17 minutes and 34 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cddab664-4154-4729-9360-6df5b3fbcaca

📥 Commits

Reviewing files that changed from the base of the PR and between 76263e6 and d5021ac.

📒 Files selected for processing (1)
  • pages/validators/genvm-configuration.mdx
📝 Walkthrough

Walkthrough

Replaced 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

Cohort / File(s) Summary
GenVM Configuration Documentation
pages/validators/genvm-configuration.mdx
Full rewrite: adds multi-provider and web-module configuration, Hot-Reload manager API steps, consolidated env var/key table, backends YAML structure with capability flags (supports_json, supports_image), provider-type examples (openai-compatible, ollama, anthropic, google, OpenRouter), expanded greyboxing/Lua strategy descriptions, new Lua exports (ExecPrompt, ExecPromptTemplate) and Prompt Template expectations, Lua Scripting API function docs, and updated validation/troubleshooting cases (e.g., NO_PROVIDER_FOR_PROMPT, all models exhausted).

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)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • cristiam86
  • kp2pml30

Poem

🐰 I hopped through configs, bright and snappy,
New backends, Lua, and hot-reload happy,
Prompts and templates neatly aligned,
Validators hum, providers combined,
A joyful twitch — docs polished and snappy! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'docs: comprehensive GenVM configuration guide' clearly describes the main change—a comprehensive rewrite of the GenVM configuration documentation.
Description check ✅ Passed The description is detailed and well-structured, covering the summary, new content, and preserved sections. It addresses the template requirements adequately.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/genvm-config-docs

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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
@MuncleUscles MuncleUscles force-pushed the feat/genvm-config-docs branch from 31a8766 to 2764f0c Compare April 9, 2026 10:45
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7977f5e and fd04dda.

📒 Files selected for processing (1)
  • pages/validators/genvm-configuration.mdx

Comment on lines +85 to +93
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
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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:4444

Based 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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between fd04dda and 76263e6.

📒 Files selected for processing (1)
  • pages/validators/genvm-configuration.mdx

Comment on lines +32 to +39
# 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}'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

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.

Suggested change
# 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".

Comment on lines +235 to +237
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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

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.

Comment on lines +327 to +333
| `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 |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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.

Suggested change
| `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.

@MuncleUscles MuncleUscles merged commit e14eef2 into main Apr 9, 2026
8 checks passed
@MuncleUscles MuncleUscles deleted the feat/genvm-config-docs branch April 9, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant