Skip to content

Hugging Face model files ​

Hosted serves model resolution paths and metadata. Proxy pulls from an upstream model hub. Consume models with the official hf CLI or huggingface_hub.

Create repositories ​

Run these Bash commands with an authenticated administrator arkactl profile and jq. Replace the endpoint and upstream address. Grant the publisher Hosted write access and the consumer read access to Group and the relevant members. For each identity, sign in and run arkactl --json tokens create --name huggingface-ci --expires-in-days 30 | jq -er .plaintext. Store each token directly in your secret manager.

bash
export ARKA_URL=https://packages.example.org
hosted=$(arkactl --json repo create --name huggingface-hosted --type hosted --format huggingface | jq -er .id)
proxy=$(arkactl --json repo create --name huggingface-proxy --type proxy --format huggingface \
  --upstream-url https://huggingface.co | jq -er .id)
arkactl repo create --name huggingface-group --type group --format huggingface --member "$hosted,$proxy"
export WRITE="$ARKA_URL/repository/huggingface-hosted"
export READ="$ARKA_URL/repository/huggingface-group"

Publish files ​

Use a fixed 40-character hexadecimal revision for reviewed files. Record the file manifest and SHA-256 digests when publishing from CI.

bash
revision=0123456789abcdef0123456789abcdef01234567
for file in config.json model.safetensors; do
  curl --fail-with-body -sS -H "Authorization: Bearer $ARKA_WRITE_TOKEN"   \
  -T "$file" "$WRITE/acme/model/resolve/$revision/$file"
done

Download and authenticate ​

bash
export HF_ENDPOINT="$READ"
export HF_TOKEN="$ARKA_READ_TOKEN"
export HF_HOME="$(mktemp -d)"
hf download acme/model config.json model.safetensors --revision "$revision" --local-dir ./model

Group searches members for the model and its files. When downloading files across members, commit and verify the full manifest. For a gated upstream model, an administrator configures an upstream service account token on Proxy with the required upstream permissions. Clients use a read token issued by Arka.

SymptomWhat to check
hf ignores the endpointSet HF_ENDPOINT before importing huggingface_hub and keep the /repository/<name> path.
HEAD succeeds but the download failsCompare X-Repo-Commit, ETag, content length, and redirect target. Try disabling the client’s Xet extension to isolate the HTTP flow.
Unexpected file versionRetry with the full revision and a fresh HF_HOME. Verify the manifest and content hashes.

Hugging Face CLI · Client environment variables

Released under the Apache 2.0 License.