Skip to content

Add local inference server auto-detection and improve stack setup#313

Closed
bussyjd wants to merge 1 commit into
feat/monetize-pathfrom
claude/merge-main-updates-Eq5JP
Closed

Add local inference server auto-detection and improve stack setup#313
bussyjd wants to merge 1 commit into
feat/monetize-pathfrom
claude/merge-main-updates-Eq5JP

Conversation

@bussyjd
Copy link
Copy Markdown
Collaborator

@bussyjd bussyjd commented Apr 7, 2026

Summary

This PR adds automatic discovery of local inference servers (llama-server, ollama, vLLM, LiteLLM) to streamline the obol sell inference workflow, improves the Obol Stack setup experience with better prerequisite checking and DNS configuration, and fixes several operational issues around file permissions and Ollama configuration.

Key Changes

Inference Server Auto-Detection

  • New module internal/inference/detect.go: Implements concurrent probing of well-known inference server ports (8080, 11434, 8000, 4000) with OpenAI-compatible /v1/models endpoint enumeration
    • ProbeEndpoint() / ProbeEndpointContext(): Probe a single host:port for inference servers
    • ScanLocalEndpoints() / ScanLocalEndpointsContext(): Concurrently scan all common ports
    • DetectServerType(): Identify server software (ollama, llama-server, openai-compat) with priority-ordered detection
    • FormatEndpointDisplay(): Pretty-print discovered endpoints and their models
  • Comprehensive test coverage in internal/inference/detect_test.go including happy path, malformed JSON, context cancellation, and error cases

CLI Integration

  • cmd/obol/sell.go: Auto-detect and prompt user to select model/upstream when --model flag is not provided and running interactively
    • Displays discovered endpoints with available models
    • Supports single-click selection for single model or numbered selection for multiple models
    • Falls back to requiring --model flag in non-interactive mode

Stack Setup & Prerequisites

  • obolup.sh:
    • New check_prerequisites() function validates Node.js 22+ / npm availability before installation
    • Improved Docker permission error detection with user-friendly guidance
    • Added configure_ollama_host_binding() to set OLLAMA_HOST=0.0.0.0 on Linux systemd for k3d container access
    • Enhanced Ollama version management with upgrade prompts and pinned version support
    • Updated pinned dependency versions with renovate annotations (kubectl 1.35.3, helm 3.20.1, helmfile 1.4.3, etc.)
    • Ensured OBOL_BIN_DIR is in PATH during dependency installation for inter-tool availability

DNS & Networking

  • internal/stack/stack.go:
    • Added wildcardDNS parameter to Up() function for opt-in wildcard DNS configuration
    • Simplified DNS setup to always use /etc/hosts entries for obol.stack (works everywhere)
    • Wildcard *.obol.stack DNS via NetworkManager/dnsmasq (Linux) or /etc/resolver (macOS) is now opt-in via --wildcard-dns flag
  • internal/dns/resolver.go: Made Linux resolver configuration non-fatal, allowing fallback to /etc/hosts on headless servers without NetworkManager

File Permissions & Volume Management

  • internal/openclaw/openclaw.go:
    • New fixVolumeOwnership() function normalizes PVC file ownership for container access (UID 1000)
    • Handles both k3d (via docker exec chown in k3d node container) and k3s (direct host chown) backends
    • Applied after workspace imports, skill injections, and keystore provisioning
  • internal/embed/infrastructure/base/templates/local-path.yaml: Changed chown to chown -R for recursive ownership fixes

Build & Deployment

  • .github/workflows/docker-publish-x402.yml: Refactored to build both x402-verifier and x402-buyer images in parallel using matrix strategy
  • renovate.json: Added custom regex rules for obolup.sh tool version updates and k3s image tag updates with proper grouping and scheduling

Documentation

  • CLAUDE.md: Updated dependency documentation with structured table of packages, key files, and roles

Notable Implementation Details

https://claude.ai/code/session_01DuimxJRYMS1KLkyURM3yYp

Resolve conflicts in CLAUDE.md (take expanded package table and deps
from main) and internal/dns/resolver.go (take quiet error style from
main, removing verbose print instructions).

https://claude.ai/code/session_01DuimxJRYMS1KLkyURM3yYp
@bussyjd bussyjd requested a review from OisinKyne April 7, 2026 09:54
@bussyjd bussyjd changed the base branch from codex/serviceoffer-controller to feat/monetize-path April 7, 2026 10:18
@bussyjd
Copy link
Copy Markdown
Collaborator Author

bussyjd commented Apr 7, 2026

Stale — #299 has been merged into feat/monetize-path directly. This merge PR is no longer needed.

@bussyjd bussyjd closed this Apr 7, 2026
@OisinKyne OisinKyne deleted the claude/merge-main-updates-Eq5JP branch April 23, 2026 19: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.

2 participants