{"id":22686427,"url":"https://github.com/lmstudio-ai/venvstacks","last_synced_at":"2026-02-27T09:09:06.221Z","repository":{"id":260260270,"uuid":"866643544","full_name":"lmstudio-ai/venvstacks","owner":"lmstudio-ai","description":"Virtual environment stacks for Python","archived":false,"fork":false,"pushed_at":"2024-12-05T06:13:02.000Z","size":17097,"stargazers_count":179,"open_issues_count":38,"forks_count":7,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-12-05T06:27:10.366Z","etag":null,"topics":["python"],"latest_commit_sha":null,"homepage":"http://venvstacks.lmstudio.ai/","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/lmstudio-ai.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.rst","contributing":".github/CONTRIBUTING.md","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":"2024-10-02T16:12:47.000Z","updated_at":"2024-12-05T06:12:24.000Z","dependencies_parsed_at":"2024-12-05T06:33:28.864Z","dependency_job_id":null,"html_url":"https://github.com/lmstudio-ai/venvstacks","commit_stats":null,"previous_names":["lmstudio-ai/venvstacks"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmstudio-ai%2Fvenvstacks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmstudio-ai%2Fvenvstacks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmstudio-ai%2Fvenvstacks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmstudio-ai%2Fvenvstacks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lmstudio-ai","download_url":"https://codeload.github.com/lmstudio-ai/venvstacks/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228976848,"owners_count":18000682,"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":["python"],"created_at":"2024-12-09T23:01:17.653Z","updated_at":"2026-02-27T09:09:06.216Z","avatar_url":"https://github.com/lmstudio-ai.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"Virtual Environment Stacks for Python\n=====================================\n\nMachine learning and AI libraries for Python are big. Really big. Nobody wants to download\nand install multiple copies of [PyTorch](https://pypi.org/project/torch/) or\n[CUDA](https://pypi.org/project/cuda-python/) if they can reasonably avoid it.\n\n``venvstacks`` allows you to package Python applications and all their dependencies into a\nportable, deterministic format, *without* needing to include copies of these large Python\nframeworks in every application archive.\n\nIt achieves this by using Python's `sitecustomize.py` environment setup feature to\nchain together three layers of Python virtual environments:\n\n* \"Runtime\" layers: environment containing the desired version of a specific Python runtime\n* \"Framework\" layers: environments containing desired versions of key Python frameworks\n* \"Application\" layers: environments containing components to be launched directly\n\nApplication layer environments may include additional unpackaged Python launch modules or\npackages for invocation with `python`'s `-m` switch.\n\nWhile the layers are archived and published separately, their dependency locking is integrated,\nallowing the application layers to share dependencies installed in the framework layers,\nand the framework layers to share dependencies installed in the runtime layers.\n\nRefer to the [Project Overview](https://venvstacks.lmstudio.ai/overview/) for an\nexample of specifying, locking, building, and publishing a set of environment stacks.\n\n\nInstalling\n----------\n\n`venvstacks` is available from the [Python Package Index](https://pypi.org/project/venvstacks/),\nand can be installed with [pipx](https://pypi.org/project/pipx/):\n\n    $ pipx install venvstacks\n\nAlternatively, it can be installed as a user level package (although this may\nmake future Python version upgrades more irritating):\n\n    $ pip install --user venvstacks\n\n\nInteractions with other packaging tools\n---------------------------------------\n\nThe base runtime environment layers are installed with `pdm` (with the installed runtimes coming\nfrom the `python-build-standalone` project). `pdm` is also used to manage the development\nof the `venvstacks` project itself.\n\nThe layered framework and app environments are created with the standard library's `venv` module.\n\nPlatform-specific environment locking for each layer is performed using `uv pip compile`,\nwith the locked requirements for lower layers being used as constraints files when\nlocking layers that depend on them.\n\nThe Python packages in each layer are installed with `uv pip install`, with the override mechanism\nbeing used to prevent installation of the packages provided by lower layers.\n\n`venvstacks` expects precompiled `wheel` archives to be available for all included\nPython distribution packages. When this is not the case, other projects like\n[`wagon`](https://pypi.org/project/wagon/#files) or\n[`fromager`](https://pypi.org/project/fromager/)\nmay be useful in generating the required input archives.\n\n\nCaveats and Limitations\n-----------------------\n\n* This project does NOT support combining arbitrary virtual environments with each other.\n  Instead, it allows larger integrated applications to split up their Python dependencies into\n  distinct layers, without needing to download and install multiple copies of large\n  dependencies (such as the PyTorch ML/AI framework). The environment stack specification\n  and build process helps ensure that shared dependencies are kept consistent across layers,\n  while unshared dependencies are free to vary across the application components that need them.\n* The `venvstacks` Python API is *not yet stable*. Any interface not specifically\n  declared as stable in the documentation may be renamed or relocated without a\n  deprecation period. API stabilisation (mostly splitting up the overly large\n  `venvstacks.stacks` namespace) will be the trigger for the 1.0 milestone release.\n* While the `venvstacks` CLI is broadly stable, there are still some specific areas\n  where changes may occur (such as in the handling of relative paths).\n* Local exports to filesystems which do not support symlinks (such as `VFAT` and\n  `FAT32`) are nominally supported (with symlinks being replaced by the files\n  they refer to), but this support is *not* currently tested.\n* To avoid relying on the Python ecosystem's still limited support for cross-platform\n  component installation, the stack build processes need to be executed on the target\n  platform (for example, by using an OS matrix in GitHub Actions). This restriction\n  also allows the layer build processing to execute some correctness checks in each\n  environment after installing the specified packages.\n\nDevelopment Guide\n-----------------\n\nSee the [development guide](https://venvstacks.lmstudio.ai/development/)\nin the main documentation.\n\nProject History\n---------------\n\nThe initial (and ongoing) development of the `venvstacks` project is being funded\nby [LM Studio](https://lmstudio.ai/), where it serves as the foundation of\nLM Studio's support for local execution of Python AI frameworks such as\n[Apple's MLX](https://lmstudio.ai/blog/lmstudio-v0.3.4).\n\nThe use of \"🐸\" (frog) and \"🦎\" (newts are often mistaken for lizards and\nvice-versa!) as the Unicode support test characters is a reference to the\ninternal LM Studio project that initially built and continues to maintain\n`venvstacks`: Project Amphibian.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmstudio-ai%2Fvenvstacks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flmstudio-ai%2Fvenvstacks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmstudio-ai%2Fvenvstacks/lists"}