Spaces:
Running
Running
|
Download sandbox/AGENTS.md from Mike0021/pi-web-runtime: direct link, hf CLI and curl.
- Browser
- Download file 2.96 kB
-
https://huggingface.co/spaces/Mike0021/pi-web-runtime/resolve/main/sandbox/AGENTS.md
- Command line
-
hf download hf://spaces/Mike0021/pi-web-runtime/sandbox/AGENTS.md
-
curl -L -o AGENTS.md https://huggingface.co/spaces/Mike0021/pi-web-runtime/resolve/main/sandbox/AGENTS.md
2.96 kB
Environment: Hugging Face Sandbox
You run inside a disposable Hugging Face Sandbox (a container on HF Jobs, in the signed-in user's own account) driven from Pi Web in a browser.
- You are
rooton Debian 12 with Node 22, npm, Python 3 (python), uv, git, git-lfs, gcc/make, ripgrep, fd, jq and zstd. You canapt-get installmore, but system packages are gone after a restart. - Hardware: see
$ACCELERATOR,$CPU_CORESand$MEMORY. Internet access is available. - Projects live in
/workspace/<name>. Only/workspaceis saved: every project is archived to a private bucket in the user's account every couple of minutes while it changes, and when the machine stops. Anything outside/workspace(global installs,~/.cache,/tmp) is lost on restart. - Dependency and build directories are not saved:
node_modules, Python virtualenvs,__pycache__,.nextand folders with aCACHEDIR.TAG(such as Rusttarget/). After a restart, reinstall before running anything (npm ci,uv sync,pip install -r requirements.txt, ...). - Nobody can open a server you start here in their browser. To check a web app, start it in the background (
nohup ... > /tmp/app.log 2>&1 &) and query it withcurl. To show the user a running app, deploy it to a Hugging Face Space. - The machine stops after a period without user activity; an agent turn in progress keeps it alive.
Hugging Face
- The Hugging Face CLI
hfis installed, with its skillhf-cli: use it for anything on the Hub. More Hugging Face skills (Spaces, datasets, training, Gradio, ...) are installed but off unless the user turned them on in Settings > Skills; the ones that are on are among your skills. - The Space lends the token of the user's sign-in to this machine:
~/.cache/huggingface/tokenholds their scoped, expiring token, sohf,huggingface_hubandgit(clone and push on huggingface.co) act as that user, within the permissions they granted. Check withhf auth whoami. The token is renewed in place; read the file when you need it rather than copying it. - If there is no token, the user has taken it back or their sign-in lapsed: do the rest of the work, then tell them to choose Sign in again or Lend my token in the Workspace menu (bottom of the sidebar), after which the token appears within seconds. Do not run
hf auth loginand never ask for a token in the chat. - Never print, log, copy or commit the token. For tools that only read
HF_TOKEN, pass it for that command:HF_TOKEN=$(cat ~/.cache/huggingface/token) node script.mjs. - What you do with it is real and billed to the user: Jobs, Inference Providers calls, new repos, pushes, pull requests. Ask before starting paid hardware or long Jobs, deleting or overwriting anything on the Hub, or publishing to a public repo; prefer a pull request over pushing to someone's main branch.
- There is no GitHub token: commit locally; the user can download a patch from the dashboard.