{ "cells": [ { "cell_type": "markdown", "id": "python-sdk-intro", "metadata": {}, "source": "# Start a Python project with Super ii\n\nUse the released `superii-sdk` to inspect this machine and prepare a real repository workflow. The catalogue can truthfully be empty, so this notebook never substitutes a fake model. Install the exact tested release first: `python -m pip install superii-sdk==0.2.2`." }, { "cell_type": "code", "execution_count": null, "id": "python-sdk-version", "metadata": {}, "outputs": [], "source": "import importlib.metadata\nimport os\nimport superii\n\nversion = importlib.metadata.version(\"superii-sdk\")\nif version != \"0.2.2\":\n raise RuntimeError(f\"Expected superii-sdk 0.2.2, found {version}\")\nprint(f\"superii-sdk {version}\")" }, { "cell_type": "markdown", "id": "inspect-hardware", "metadata": {}, "source": "## Inspect before acquiring\n\nHardware inspection stays on this computer. It is a planning input, not a benchmark or a guarantee that an arbitrary model will fit." }, { "cell_type": "code", "execution_count": null, "id": "hardware-report", "metadata": {}, "outputs": [], "source": "machine = superii.hardware()\nprint(machine)" }, { "cell_type": "markdown", "id": "select-real-repository", "metadata": {}, "source": "## Inspect a real reviewed repository\n\nSet `SUPERII_REPOSITORY` to an actual `owner/slug` from the live catalogue. Inspection resolves metadata and immutable evidence only; it does not execute repository code." }, { "cell_type": "code", "execution_count": null, "id": "inspect-and-plan", "metadata": {}, "outputs": [], "source": "repository = os.getenv(\"SUPERII_REPOSITORY\", \"\").strip()\nmanifest = None\nplan = None\nif not repository:\n print(\"Set SUPERII_REPOSITORY after choosing a real reviewed model.\")\nelse:\n manifest = superii.inspect(repository)\n plan = superii.plan(manifest, machine=machine)\n print(manifest)\n print(plan)" }, { "cell_type": "markdown", "id": "explicit-acquisition", "metadata": {}, "source": "## Make acquisition explicit\n\nDownloading is separate from inspection. Keep the guard off until you have reviewed the exact revision, selected files, size, license, and plan. Every acquired file is verified by SHA-256 before use." }, { "cell_type": "code", "execution_count": null, "id": "guarded-pull", "metadata": {}, "outputs": [], "source": "ALLOW_DOWNLOAD = False\nif ALLOW_DOWNLOAD and repository and plan is not None:\n snapshot = superii.pull(repository, revision=plan.revision, files=tuple(plan.files))\n if not superii.verify(snapshot):\n raise RuntimeError(\"Snapshot verification failed closed\")\n print(snapshot.path)\nelse:\n print(\"No files downloaded. Review the plan, then set ALLOW_DOWNLOAD = True.\")" } ], "metadata": { "kernelspec": {"display_name": "Python 3", "language": "python", "name": "python3"}, "language_info": {"name": "python", "version": "3.12"} }, "nbformat": 4, "nbformat_minor": 5 }