File size: 1,835 Bytes
39371ea f104170 9c380c2 39371ea | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | <!doctype html>
<html lang="en"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Browser HTTP experiment</title>
<style>html{color-scheme:dark;background:#18181e;color:#e4e4eb;font:17px/1.6 system-ui}body{max-width:760px;margin:40px auto;padding:0 20px}a{color:#a4e2d4}pre{background:#262630;padding:16px;overflow:auto;border-radius:12px}code{font-size:14px}</style>
<h1>HTTP from the browser shell</h1>
<p>This experimental copy enables real <code>curl</code> requests. The model and shell run on your device. Requests go directly from your browser to the destination; there is no proxy. Request URLs, headers, and bodies are sent to that service.</p>
<p>Any HTTPS URL is allowed, including GitHub Gists; there is no host allowlist. The destination must still permit browser access with CORS. GET, HEAD, and POST are enabled. Cookies are omitted. Requests have an 8-second deadline and a 1 MiB response limit.</p>
<h2>Try in Shell</h2>
<pre>curl -fsS https://jsonplaceholder.typicode.com/todos/1 -o todo.json
jq '{id, title, completed}' todo.json</pre>
<pre>set -o pipefail
curl -fsS https://api.github.com/repos/huggingface/transformers.js | jq '{full_name, stargazers_count}'</pre>
<h2>Ask Pi</h2>
<p>“Fetch https://jsonplaceholder.typicode.com/todos/1, save it as todo.json, and tell me its title and whether it is completed.”</p>
<p>The destination must allow browser access with CORS. Redirects are reported as errors: use the final URL directly, with the exact capitalization. A plain curl pipeline can hide an error unless you enable <code>set -o pipefail</code>. Python, Node.js, npm, and native binaries remain unavailable.</p>
<p><a href="./">Back to the workspace</a> · <a href="https://huggingface.co/spaces/victor/MiniCPM5-2B-WebGPU-Pi">Original Space</a></p>
</html>
|