1
0
Fork 0
mirror of https://github.com/p-e-w/heretic.git synced 2026-12-03 18:42:57 +07:00

[GH-ISSUE #275] feat: hot-reloadable LLM judge endpoint config #155

Closed
opened 2026-11-01 04:18:06 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @aider4ryder on GitHub (Apr 4, 2026).
Original GitHub issue: https://github.com/p-e-w/heretic/issues/275

Summary

Make the LLM judge endpoint configuration hot-reloadable from config.toml, so the backend can be switched between Ollama, vLLM, or cloud APIs without restarting heretic.

Current State

  • Judge API key is set via LLM_JUDGE_API_KEY env var (static, requires restart to change)
  • Judge endpoint is hardcoded to Ollama API format
  • Switching judge backend requires killing and restarting the entire heretic process, losing trial boundary timing
  • Note: judge.toml / judge.default.toml already exist — judge config is partially separated

Proposed Design

Add a [llm_judge] section to config.toml:

```toml
[llm_judge]
base_url = "http://localhost:11434/v1" # Ollama default
api_key = "sk-..."
model = "gemma3:27b"
```

Hot-reload behavior

  • Check config.toml mtime before each trial (or every N trials)
  • If changed, reload [llm_judge] section and log the change
  • All backends use unified OpenAI-compatible /v1/chat/completions format

Example usage

```bash

Start heretic with Ollama judge

uv run heretic

Mid-run: switch to vLLM for faster judge (edit config.toml)

base_url = "http://localhost:8100/v1"

model = "gemma3:27b"

Mid-run: switch to cloud API for higher quality judge

base_url = "https://api.x.ai/v1"

model = "grok-4"

```

Motivation

  • vLLM continuous batching provides ~12.5x throughput over Ollama for judge inference
  • During long optimization runs (100+ trials), being able to switch judge backend without restart saves hours
  • Aligns with hot-reloadable config pattern used in the broader project
  • Enables A/B testing different judge models mid-run
Originally created by @aider4ryder on GitHub (Apr 4, 2026). Original GitHub issue: https://github.com/p-e-w/heretic/issues/275 ## Summary Make the LLM judge endpoint configuration hot-reloadable from `config.toml`, so the backend can be switched between Ollama, vLLM, or cloud APIs without restarting heretic. ## Current State - Judge API key is set via `LLM_JUDGE_API_KEY` env var (static, requires restart to change) - Judge endpoint is hardcoded to Ollama API format - Switching judge backend requires killing and restarting the entire heretic process, losing trial boundary timing - Note: `judge.toml` / `judge.default.toml` already exist — judge config is partially separated ## Proposed Design Add a `[llm_judge]` section to `config.toml`: \`\`\`toml [llm_judge] base_url = "http://localhost:11434/v1" # Ollama default api_key = "sk-..." model = "gemma3:27b" \`\`\` ### Hot-reload behavior - Check `config.toml` mtime before each trial (or every N trials) - If changed, reload `[llm_judge]` section and log the change - All backends use unified OpenAI-compatible `/v1/chat/completions` format ### Example usage \`\`\`bash # Start heretic with Ollama judge uv run heretic # Mid-run: switch to vLLM for faster judge (edit config.toml) # base_url = "http://localhost:8100/v1" # model = "gemma3:27b" # Mid-run: switch to cloud API for higher quality judge # base_url = "https://api.x.ai/v1" # model = "grok-4" \`\`\` ## Motivation - vLLM continuous batching provides ~12.5x throughput over Ollama for judge inference - During long optimization runs (100+ trials), being able to switch judge backend without restart saves hours - Aligns with hot-reloadable config pattern used in the broader project - Enables A/B testing different judge models mid-run
Author
Owner

@aider4ryder commented on GitHub (Apr 4, 2026):

Opened on wrong repo — moving to fork.

<!-- gh-comment-id:4187588799 --> @aider4ryder commented on GitHub (Apr 4, 2026): Opened on wrong repo — moving to fork.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
p-e-w/heretic#155
No description provided.