{ "cells": [ { "cell_type": "markdown", "id": "runtime-intro", "metadata": {}, "source": "# Plan a Use Model runtime safely\n\nRead the public runtime registry, inspect local hardware, and plan one real reviewed model before acquisition. Compatibility is evidence for planning—not a benchmark, safety certification, or zero-out-of-memory guarantee." }, { "cell_type": "code", "execution_count": null, "id": "runtime-registry", "metadata": {}, "outputs": [], "source": "import json\nimport os\nfrom urllib.request import Request, urlopen\n\nORIGIN = \"https://superii.site\"\nrequest = Request(f\"{ORIGIN}/runtime-registry.json\", headers={\"Accept\": \"application/json\"})\nwith urlopen(request, timeout=20) as response:\n registry = json.load(response)\nprint(json.dumps(registry, indent=2)[:5000])" }, { "cell_type": "markdown", "id": "local-plan", "metadata": {}, "source": "## Match a real revision to this machine\n\nInstall `superii-sdk==0.2.2`, then set `SUPERII_REPOSITORY` to an actual `owner/slug`. Inspection and planning do not execute model code. Unsupported or ambiguous formats fail with a reason." }, { "cell_type": "code", "execution_count": null, "id": "model-plan", "metadata": {}, "outputs": [], "source": "import superii\n\nrepository = os.getenv(\"SUPERII_REPOSITORY\", \"\").strip()\nmachine = superii.hardware()\nif repository:\n manifest = superii.inspect(repository)\n selected = superii.plan(manifest, machine=machine, context_size=4096)\n print(selected)\nelse:\n manifest = selected = None\n print(\"Choose a reviewed live model and set SUPERII_REPOSITORY.\")" }, { "cell_type": "markdown", "id": "runtime-boundary", "metadata": {}, "source": "## Acquire and run only after review\n\nReview the immutable revision, license, selected files, byte estimate, runtime, and trust boundary. The default below performs no download and starts no persistent inference service." }, { "cell_type": "code", "execution_count": null, "id": "guarded-model-use", "metadata": {}, "outputs": [], "source": "ALLOW_ACQUISITION = False\nALLOW_LOCAL_INFERENCE = False\n\nif ALLOW_ACQUISITION and repository and selected is not None:\n snapshot = superii.pull(repository, revision=selected.revision, files=tuple(selected.files))\n if not superii.verify(snapshot):\n raise RuntimeError(\"Verified acquisition failed closed\")\n print(f\"Verified snapshot: {snapshot.path}\")\n if ALLOW_LOCAL_INFERENCE:\n with superii.load(repository, revision=selected.revision) as model:\n print(model.generate(\"Explain your intended use limits.\", max_tokens=128))\nelse:\n print(\"No model bytes acquired and no inference started.\")" } ], "metadata": { "kernelspec": {"display_name": "Python 3", "language": "python", "name": "python3"}, "language_info": {"name": "python", "version": "3.12"} }, "nbformat": 4, "nbformat_minor": 5 }