Skip to content

huggingface/harbor-hf

Run reproducible Harbor benchmarks on Hugging Face infrastructure.

https://skillcdn.ai/gh/huggingface/harbor-hf

Connect this address to your AI to use this skill. How to connect

  • Unverified
  • Default branchmain
  • Commitf78149d
  • LicenseApache-2.0
  • Searchwords
View on GitHub

harbor-hf

Submit, monitor, pause, resume, cancel, and inspect Harbor benchmark runs through the hosted Harbor-HF control service and Hugging Face Jobs.

Path
.agents/skills/harbor-hf/SKILL.md
License
Apache-2.0

Harbor-HF operations

Use this skill for Harbor benchmark runs on Hugging Face infrastructure.

Harbor-HF has two persistent resources:

  • one private control Space
  • one private Bucket for run records and Harbor output

Do not create a run-specific repository, Space, Bucket, Dataset, endpoint, or coordination store. Use the existing control service and Bucket.

Read the current contract

Before an operation, read these files from the Harbor-HF repository:

  • docs/2026-09-04-simplification-implementation-spec.md
  • docs/CONTROL_SERVICE.md
  • docs/architecture.md

Use the paid-compute-launch skill before a paid Job launch, retry, or resume. Use the Hugging Face CLI and Spaces skills for Hub and Space operations.

Keep credentials separate

The control Space has two secrets:

  • HF_TOKEN controls the Bucket and HF Jobs.
  • HF_INFERENCE_TOKEN is for model inference through the Hugging Face router.

Do not print either value. Do not put a credential literal in a run request, Bucket object, Job label, log, or result. The control service gives both secrets to the reviewed parent Job as ephemeral Job secrets. The parent uses the control token to start and label child Sandbox Jobs. The benchmark agent receives only the inference token through the fixed ${HF_INFERENCE_TOKEN} template. Pi uses its built-in Hugging Face provider so model prices remain available for Harbor cost accounting.

Do not copy a token to another store. Use a configured token in place.

Submit a run

Prefer a reviewed preset in the web console or POST /api/v1/runs. A preset submission selects:

  • one benchmark preset
  • one model ID and provider
  • one agent preset and reasoning value
  • one positive maximum cost in USD for the complete campaign
  • a final or diagnostic role

Use a unique Idempotency-Key. A repeated key with the same request adopts the existing run. A repeated key with different content is an error.

Use a direct Harbor JobConfig only when a preset cannot express the test:

uv run harbor-hf submit \
  --config job.yaml \
  --cost-ceiling-usd 100

The service replaces caller-controlled paths, environment, and router credentials. It rejects unknown fields, multiple agents, source jobs, local paths, caller-supplied agent environments or skills, custom environments, credential literals, and credentials in URLs. Direct runs are diagnostic and cannot enter the leaderboard.

Failure signatures:

  • control API returned 404: request rejected (or any reply that is not the API's error JSON) means the request never reached the control service. Check HARBOR_HF_CONTROL_URL before suspecting credentials. The control Space is private, so a wrong hostname is rejected by the Space edge with exactly this shape. The correct host is the deployment's own owner-prefixed Space host (<owner>-<control-space>.hf.space); the exact value lives in the operator's environment configuration, never in tracked files.
  • Failed to import module '<package>' on a direct JobConfig submit means the agent's package is not installed in the control image. That is a wrong door, not a broken install: reviewed third-party agents go through the preset route (POST /api/v1/runs), whose imports are validated where they run, on the parent worker. Never install benchmark-specific agent packages into the control service to fix this.
  • The client config enforces deployment floors on the campaign cost ceiling (typically a $100 minimum per campaign). The ceiling is an enforced abort bound, not expected spend; a one-trial diagnostic costs cents against it.

Inspect and control runs

Set these environment variables without printing their values:

HARBOR_HF_CONTROL_URL
HARBOR_HF_CONTROL_BEARER_TOKEN

Use the thin client:

uv run harbor-hf run list
uv run harbor-hf run status <run-id>
uv run harbor-hf jobs
uv run harbor-hf presets
uv run harbor-hf run pause <run-id>
uv run harbor-hf run resume <run-id>
uv run harbor-hf run cancel <run-id> --yes

A pause cancels the active parent and labeled child Jobs. Resume starts a new parent against the same Harbor job/ folder. Harbor skips completed trials. Cancellation is permanent.

The Bucket is the durable source of truth. SQLite is a disposable three-table projection. HF Job state is an observation, not the run record.

Do not overload Hugging Face infrastructure

The hosted namespace keeps every finished Job, and the Bucket holds millions of objects. Read the Hub request audit.

  • Use uv run harbor-hf jobs and run status for state. They read the service projection, not the Hub.
  • Never list the namespace's Jobs without a live stage filter. With the Hub client, pass status=["RUNNING", "SCHEDULING"] and a label to list_jobs. Read a known Job with inspect_job by ID. Do not page through history to count Jobs.
  • Never list a run folder recursively or download a whole run to inspect it. Download the named files you need.
  • Keep inference concurrency for agents and judges within the route's limit. Start at 6 parallel sessions per route, and lower it when HTTP 429 appears.
  • Poll a run no faster than every 30 seconds.

Cost and completion rules

The campaign cost ceiling is checked after each trial because Harbor writes the result before it calls the end hook. The parent writes one immutable cost receipt for each Harbor attempt before Harbor can remove a failed retry folder. It reloads these receipts after restart. A missing cost stays null in the receipt and contributes zero to the ceiling calculation. It does not stop other work.

The ceiling applies to the sum of all trial-attempt costs in the campaign. It is not divided into per-trial limits. With concurrent trials, work that is already active can finish before cancellation, so reported cost can exceed the ceiling.

Treat a run as complete only when:

  • Harbor wrote job/result.json with a finished status;
  • no labeled parent or child Job is active;
  • each expected trial has a durable Harbor result;
  • the known trial cost total is within the approved limit; and
  • the projection rebuild gives the same run state.

Only completed final runs from a leaderboard-eligible preset, with at least one score, enter the public leaderboard.

Stop conditions

Stop automatic work and report evidence for:

  • credential exposure or token reuse;
  • a Harbor, benchmark, image, or backend revision mismatch;
  • a deterministic shared parent or child defect;
  • duplicate logical execution;
  • cost outside the approved limit;
  • an immutable run-record conflict;
  • a Bucket integrity or Harbor resume failure; or
  • a labeled Job that the reconciler cannot stop.

Do not bypass a stop by creating another resource, copying a credential, or using an unreviewed runtime.

Files of this skill

This skill has no supporting files.

Browse all supporting files