feat: autoresearch marketplace foundations — worker seller flow, provenance, coordinator fixes#265
feat: autoresearch marketplace foundations — worker seller flow, provenance, coordinator fixes#265
Conversation
…app deployment pattern Add provenance metadata to ServiceOffer CRD and CLI, new embedded skills for autoresearch model optimization and distributed GPU coordination, and a validated pattern for agent-deployed x402-gated web apps. Closes #264
--per-hour was passing the raw hourly price as the per-request charge (e.g., $0.50/hour charged $0.50 per HTTP request). Now approximates using a 5-minute experiment budget: perRequest = perHour * 5/60. Also rewrites worker_api.py to use stdlib http.server (no Flask dep).
…eWarning - Move Dockerfile.worker from repo root to internal/embed/skills/autoresearch-worker/docker/Dockerfile (build context is the skill directory, not the obol-stack root) - Add Gateway API request timeout on HTTPRoutes when payment.maxTimeoutSeconds > 30s. Derived as maxTimeout + 120s overhead. Prevents Traefik from killing long-running GPU experiment requests (300s+) before the worker responds. - Fix ResourceWarning: close HTTPError responses in coordinator _http_post and persona test post_json helpers.
| def ollama_create(model_name: str, modelfile_path: Path) -> None: | ||
| """Register the model with Ollama.""" | ||
| print(f"Creating Ollama model: {model_name}") | ||
| run( | ||
| ["ollama", "create", model_name, "-f", str(modelfile_path)], | ||
| capture=False, | ||
| ) | ||
| print(f"Model '{model_name}' registered with Ollama") |
There was a problem hiding this comment.
Is the autoresearcher only for publishing models?
There was a problem hiding this comment.
No — publish.py is just one piece. The autoresearch integration covers three flows:
- Model optimization + publishing (this script) — autonomous train loop, selects the best checkpoint, generates provenance, publishes to Ollama, optionally sells inference via
obol sell inference --provenance-file - GPU worker monetization (
autoresearch-workerskill +Dockerfile.worker+worker_api.py) — exposes a worker HTTP API (POST /experiment,GET /best, etc.), runs one experiment at a time, sold viaobol sell httpwith x402 payment gating and ERC-8004 registration - Distributed coordination (
autoresearch-coordinatorskill) — discovers GPU workers via 8004scan, submits experiments with x402 micropayments, collects results across workers, tracks a leaderboard
The upstream autoresearch project is an agent-driven LLM research loop (agent edits train.py, runs 5-min GPU experiments, measures val_bpb, iterates). autoresearch-at-home extends it with swarm coordination via Ensue shared memory (claim experiments, publish results, exchange hypotheses/insights across agents on different GPUs).
This PR integrates that ecosystem into obol-stack's marketplace: workers sell GPU compute, coordinators discover and pay them, and published models carry provenance metadata (experiment ID, train hash, metric) all the way into the ERC-8004 on-chain registration.
Summary
This PR adds the first solid marketplace foundations for autoresearch on obol-stack:
The goal is to support three paths over time:
This PR mainly strengthens the GPU seller and coordinator foundations.
What’s included
1. Canonical provenance support
Adds a consistent provenance shape across:
publish.py--provenance-fileServiceOffer.spec.provenanceagent-registration.jsonCanonical provenance shape:
{ "framework": "autoresearch", "metricName": "val_bpb", "metricValue": "0.9973", "experimentId": "abc123def456", "trainHash": "sha256:deadbeefcafebabe", "paramCount": "50000000" }Key fixes:
metricobjecttrainHashexplicitlysha256:...paramCountstringified consistently2. GPU seller flow
Adds a concrete seller-side worker implementation:
Dockerfile.workerautoresearch-workerworker_api.pyexposing:GET /healthGET /healthzGET /statusGET /bestGET /experiments/<id>POST /experimentWorker behavior:
val_bpbtrain_hash409while busyThis gives a concrete path for:
obol sell http3. Richer registration metadata for GPU workers
Adds support for passing structured worker metadata at sell time:
Changes:
cmd/obol/sell.goadds--register-metadata key=valuespec.registration.metadatamonetize.pynow:registration.metadatain generatedagent-registration.jsonmetadata.<key>This makes GPU workers easier to discover, compare, and rank.
4. Coordinator fixes for current APIs
Fixes the autoresearch coordinator to match the current external APIs:
8004scan:
/api/v1/public/agentsdataresponse shaperaw_metadata.offchain_contentOASF extraction:
services[]entry withname: "OASF"remote-signer:
GET /api/v1/keysPOST /api/v1/sign/<address>/typed-dataThis resolves the previous mismatch where the coordinator used stale 8004scan behavior and old
eth2signer endpoints.5. Documentation refresh
Refreshes the autoresearch coordinator docs/references so they match the code:
/services/autoresearch-workerCommits included
4b992f5feat: add autoresearch GPU worker sell-side flow3506ad4feat: add richer GPU worker registration metadatadc81c85fix: unify canonical provenance schema2e9a436fix: align autoresearch coordinator with current APIs71a42d2docs: refresh autoresearch coordinator referencesValidation performed locally
Validated in this environment:
py_compileon touched Python filescoordinate.py discover --limit 1against the current 8004scan APINotes / scope
This PR improves the marketplace foundations, but it does not yet claim:
It is best understood as:
Follow-up work
Likely next steps after this PR:
Closes #264