Name | lightning-sdk JSON |
Version |
0.1.41
JSON |
| download |
home_page | None |
Summary | SDK to develop using Lightning AI Studios |
upload_time | 2024-12-17 21:30:03 |
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 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. ",
"summary": "SDK to develop using Lightning AI Studios",
"version": "0.1.41",
"project_urls": null,
"split_keywords": [
"deep learning",
" machine learning",
" pytorch",
" ai"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ae4eaa0ec1dafb2747bc062563f83892e960b91934bc4d7258c35f16a5ffad4b",
"md5": "0cc9d549cea32f0554e29ceca6edd204",
"sha256": "ef9ef13fc6fcc6104063151bbc01b6fa2a0d018b338b37899312809ec16960a0"
},
"downloads": -1,
"filename": "lightning_sdk-0.1.41-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0cc9d549cea32f0554e29ceca6edd204",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 1581790,
"upload_time": "2024-12-17T21:30:03",
"upload_time_iso_8601": "2024-12-17T21:30:03.406303Z",
"url": "https://files.pythonhosted.org/packages/ae/4e/aa0ec1dafb2747bc062563f83892e960b91934bc4d7258c35f16a5ffad4b/lightning_sdk-0.1.41-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-17 21:30:03",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "lightning-sdk"
}