Name | lightning-sdk JSON |
Version |
2025.7.17
JSON |
| download |
home_page | None |
Summary | SDK to develop using Lightning AI Studios |
upload_time | 2025-07-17 00:55:45 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | MIT License
Copyright (c) 2024 Grid.ai
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
|
keywords |
deep learning
machine learning
pytorch
ai
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Lightning SDK
Software Development Kit (SDK) for Lightning AI
## Installation
The package can be installed using `pip install lightning-sdk`
## Usage
To use the SDK, you need to export the environment variables `LIGHTNING_USER_ID` and `LIGHTNING_API_KEY` with the values found in your account settings -> Keys -> Programmatic Login.
If you want to use it from within a Studio, these variables are already available for you.
## Example
```python
from lightning_sdk import Machine, Studio
# or s = Studio("my-studio", "my-teamspace", org="my-org", create_ok=True)
# or (inside a Studio) s = Studio() # will infer name, teamspace and owner of the current studio automatically.
# can also just pass some arguments: s = Studio("my-new-studio", create_ok=True)
s = Studio("my-studio", "my-teamspace", user="my-username", create_ok=True)
print("starting Studio...")
s.start()
# prints Machine.CPU-4
print(s.machine)
# or start directly on this machine with s.start(Machine.A10G)
print("switching Studio machine...")
s.switch_machine(Machine.A10G)
# prints Machine.A10G
print(s.machine)
# prints Status.Running
print(s.status)
print(s.run("nvidia-smi"))
# install plugins for jobs and multi-machine training
s.install_plugin("jobs")
s.install_plugin("multi-machine-training")
# run the resulting plugins to start 1 job and 1 multi-machine training
s.installed_plugins["jobs"].run("python my_dummy_file", name="my_first_job", machine=Machine.A10G)
s.installed_plugins["multi-machine-training"].run("python my_dummy_file", name="my_first_mmt", machine=Machine.T4, num_instances=42)
print("Stopping Studio")
s.stop()
# duplicates Studio, this will also duplicate the environment and all files in the Studio
duplicate = s.duplicate()
# delete original Studio, duplicated Studio is it's own entity and not related to original anymore
s.delete()
# stop and delete duplicated Studio
duplicate.stop()
duplicate.delete()
```
Raw data
{
"_id": null,
"home_page": null,
"name": "lightning-sdk",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "deep learning, machine learning, pytorch, AI",
"author": null,
"author_email": "Lightning-AI <justus@lightning.ai>",
"download_url": null,
"platform": null,
"description": "# Lightning SDK\n\nSoftware Development Kit (SDK) for Lightning AI\n\n## Installation\n\nThe package can be installed using `pip install lightning-sdk`\n\n## Usage\n\nTo use the SDK, you need to export the environment variables `LIGHTNING_USER_ID` and `LIGHTNING_API_KEY` with the values found in your account settings -> Keys -> Programmatic Login.\n\nIf you want to use it from within a Studio, these variables are already available for you.\n\n## Example\n\n```python\nfrom lightning_sdk import Machine, Studio\n\n# or s = Studio(\"my-studio\", \"my-teamspace\", org=\"my-org\", create_ok=True)\n# or (inside a Studio) s = Studio() # will infer name, teamspace and owner of the current studio automatically.\n# can also just pass some arguments: s = Studio(\"my-new-studio\", create_ok=True)\ns = Studio(\"my-studio\", \"my-teamspace\", user=\"my-username\", create_ok=True)\n\nprint(\"starting Studio...\")\ns.start()\n\n# prints Machine.CPU-4\nprint(s.machine)\n\n# or start directly on this machine with s.start(Machine.A10G)\nprint(\"switching Studio machine...\")\ns.switch_machine(Machine.A10G)\n\n# prints Machine.A10G\nprint(s.machine)\n\n# prints Status.Running\nprint(s.status)\n\nprint(s.run(\"nvidia-smi\"))\n\n# install plugins for jobs and multi-machine training\ns.install_plugin(\"jobs\")\ns.install_plugin(\"multi-machine-training\")\n\n# run the resulting plugins to start 1 job and 1 multi-machine training\ns.installed_plugins[\"jobs\"].run(\"python my_dummy_file\", name=\"my_first_job\", machine=Machine.A10G)\ns.installed_plugins[\"multi-machine-training\"].run(\"python my_dummy_file\", name=\"my_first_mmt\", machine=Machine.T4, num_instances=42)\n\nprint(\"Stopping Studio\")\ns.stop()\n\n# duplicates Studio, this will also duplicate the environment and all files in the Studio\nduplicate = s.duplicate()\n\n# delete original Studio, duplicated Studio is it's own entity and not related to original anymore\ns.delete()\n\n# stop and delete duplicated Studio\nduplicate.stop()\nduplicate.delete()\n```\n",
"bugtrack_url": null,
"license": "MIT License\n \n Copyright (c) 2024 Grid.ai\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n ",
"summary": "SDK to develop using Lightning AI Studios",
"version": "2025.7.17",
"project_urls": null,
"split_keywords": [
"deep learning",
" machine learning",
" pytorch",
" ai"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "3c1a4df13a6b6929bced6a9a290afeb256c3d8d8b284d9285fab50daff63a092",
"md5": "4dcd1e91b5ff8f6864b9e881a094521c",
"sha256": "93cb49eeefef3a7d2574f6d7acfa617462f81ff90788ffb34368a2a0c1c539f5"
},
"downloads": -1,
"filename": "lightning_sdk-2025.7.17-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4dcd1e91b5ff8f6864b9e881a094521c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 2128244,
"upload_time": "2025-07-17T00:55:45",
"upload_time_iso_8601": "2025-07-17T00:55:45.768685Z",
"url": "https://files.pythonhosted.org/packages/3c/1a/4df13a6b6929bced6a9a290afeb256c3d8d8b284d9285fab50daff63a092/lightning_sdk-2025.7.17-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-17 00:55:45",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "lightning-sdk"
}