{"id":26633061,"url":"https://github.com/z0u/mi-ni","last_synced_at":"2026-04-11T00:50:51.461Z","repository":{"id":279512754,"uuid":"939058831","full_name":"z0u/mi-ni","owner":"z0u","description":"Template project for AI experiments","archived":false,"fork":false,"pushed_at":"2025-03-23T07:47:35.000Z","size":680,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T08:27:39.977Z","etag":null,"topics":["ai","experiments","gpu","jupyter","ml","notebooks","research-tool"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/z0u.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-25T23:29:58.000Z","updated_at":"2025-03-23T07:47:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"21932f01-e475-47ce-861d-3411b5b482a9","html_url":"https://github.com/z0u/mi-ni","commit_stats":null,"previous_names":["z0u/ai-research","z0u/mi-ni"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z0u%2Fmi-ni","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z0u%2Fmi-ni/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z0u%2Fmi-ni/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z0u%2Fmi-ni/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/z0u","download_url":"https://codeload.github.com/z0u/mi-ni/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245294776,"owners_count":20591909,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","experiments","gpu","jupyter","ml","notebooks","research-tool"],"created_at":"2025-03-24T15:13:28.763Z","updated_at":"2026-02-09T13:16:45.511Z","avatar_url":"https://github.com/z0u.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e **\u003cruby\u003e見\u003crt\u003eみ\u003c/rt\u003eに\u003c/ruby\u003e /mi·ni/** — _with intent to see_ [^etymology]\n\n[^etymology]: From 見に行く (mi-ni iku), meaning \"to go for the purpose of seeing something.\" This library is about small AI experiments—quick, lightweight explorations to try and see what happens.\n\nThis is a template repository for doing AI research. Features:\n\n- **Local Python notebooks**\n- **Remote per-function GPU compute** [^modal]\n- **Inline visualization** with remote-to-local callbacks\n- **AI-assisted coding** with Copilot/VS Code\n\n[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/z0u/mi-ni/tree/v1)\n\n\u0026nbsp;\n\n![Screen recording of a notebook cell in VS Code, with code to run a distributed training job and an inline loss chart that updates in real-time.](https://github.com/user-attachments/assets/c2b49baa-b064-4425-ab92-f183f90374a3)\n\n\u003e Above: screen recording of a local notebook running a remote training job [^edited]. **a:** `track` is a function that runs locally — even when called from the remote function. **a':** The plot is displayed directly in the notebook, showing training metrics in real time. **b:** `train` is a function that runs in the cloud (with a GPU). **b':** The message \"Training complete\" is printed remotely, but the output is shown locally (no callback needed). **c:** A `with` statement creates a context that bridges the remote and local environments.\n\n[^edited]: The recording was edited: 1. labels were added; 2. the remote `train()` function was moved to the right so that the video wouldn't take up so much vertical space.\n\nRead about how it works in [Hither-thither architecture](docs/hither-thither.md).\n\n\u003cdetails\u003e\u003csummary\u003eCode for the above demo\u003c/summary\u003e\n\nThe code shown in the screen recording is:\n\n```python\n@run.hither\nasync def track(loss: float):\n    history.append(loss)\n    plot(history)\n\n@run.thither(gpu='L4')\nasync def train(epochs: int, track):\n    for _ in range(epochs):\n        track(some_training_function())\n    print('Training complete')\n\nasync with run(), track as callback:\n    await train(25, callback)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eMore cool features\u003c/summary\u003e\n\n- [Dev container][dc] for a consistent environment, both locally and in [Codespaces][codespaces]\n- ML stack ([PyTorch, Polars, etc.](pyproject.toml))\n- Modern package management with [uv]\n- Pre-configured for good engineering practices: tests, linting, type-checking (optional!)\n\u003c/details\u003e\n\n[^modal]: [Modal] is used for remote compute. They charge per-second, billed for the duration of your function.\n\n\u0026nbsp;\n\n## Getting started\n\nFirst, [open in GitHub Codespaces](https://codespaces.new/z0u/mi-ni). Then:\n\n```bash\n./go install  # CPU deps for local venv\n./go auth     # Authenticate with Modal for remote compute\n```\n\nOpen the [Getting Started notebook](./docs/getting-started.ipynb) and try it out (choose `.venv/bin/python3` as the kernel). For a more complete example, have a look at the [nanoGPT notebook](./docs/nanogpt.ipynb).\n\n[codespaces]: https://github.com/features/codespaces\n\n\u003cdetails\u003e\u003csummary\u003eVirtual environment\u003c/summary\u003e\n\nThe Python environment is configured when the dev container is created.\n\nUse [uv] to add and remove packages, and to run scripts:\n\n```bash\nuv add plotly --group local\nuv run python example.py\n```\n\nInstead of using `uv sync` to install the added packages, use `./go install` instead. It remembers whether you have installed cpu or gpu packages.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eRestarting the language server (VS Code)\u003c/summary\u003e\n\nIf you open a Python file before the setup is complete, you may need to restart the Python language server.\n\n- Open a `.py` or `.ipynb` file\n- Open the command pallette with \u003ckbd\u003e⇧\u003c/kbd\u003e\u003ckbd\u003e⌘\u003c/kbd\u003e\u003ckbd\u003eP\u003c/kbd\u003e or \u003ckbd\u003eCtrl\u003c/kbd\u003e\u003ckbd\u003eShift\u003c/kbd\u003e\u003ckbd\u003eP\u003c/kbd\u003e\n- Run _Python: Restart Language Server_.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eWorking with large files (Git LFS)\u003c/summary\u003e\n\nThis project is preconfigured to use [Git LFS](https://git-lfs.com). If you commit a matching file, it won't clog up your main Git history. By default, files in `docs/large-assets/` are stored in LFS, but you can change that by editing `.gitattributes`.\n\nTypically, you would store _data_ rather than code in LFS:\n\n- training data\n- model weights\n- visualizations (images and video)\n\nFor matplotlib figures, use `utils.nb.save_fig` instead of displaying them directly: that stores them outside the notebook, which makes the notebook easier to view in `git diff`, and easier for AI assistants to process (because the notebook contains fewer tokens).\n\n\u003c/details\u003e\n\n[dc]: https://containers.dev\n[Modal]: https://modal.com\n[uv]: https://astral.sh/uv\n\n\u0026nbsp;\n\n## Contributing \u0026 licence\n\nThis project is dedicated to the public domain [^unlicense][^attrib]. In your own experiments, there's no need to contribute back! The code is yours to modify as you please.\n\nIf you do want to contribute to _this template_, then fork it as usual. Before making a pull request, run:\n\n```bash\n./go check\n```\n\n[^not-fork]: Since your project isn't a fork, you don't need to worry about keeping the code in sync, and you can add and remove Python packages as you wish.\n[^unlicense]: Technically, the licence is the [Unlicense](https://unlicense.org), which is about as close as you can get to \"do whatever you want\".\n[^attrib]: Exception: Code in `src/experiment` is derived from [nanoGPT](https://github.com/karpathy/nanoGPT) by Andrej Karpathy and is subject to MIT license terms. See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fz0u%2Fmi-ni","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fz0u%2Fmi-ni","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fz0u%2Fmi-ni/lists"}