Name | llm-jupyter JSON |
Version |
0.2.0
JSON |
| download |
home_page | None |
Summary | Run a IPython interpreter in the LLM virtual environment |
upload_time | 2024-05-17 15:42:45 |
maintainer | None |
docs_url | None |
author | Simon Willison |
requires_python | None |
license | Apache-2.0 |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# llm-jupyter
[![PyPI](https://img.shields.io/pypi/v/llm-jupyter.svg)](https://pypi.org/project/llm-jupyter/)
[![Changelog](https://img.shields.io/github/v/release/lucasrcezimbra/llm-jupyter?include_prereleases&label=changelog)](https://github.com/lucasrcezimbra/llm-jupyter/releases)
[![Tests](https://github.com/lucasrcezimbra/llm-jupyter/workflows/Test/badge.svg)](https://github.com/lucasrcezimbra/llm-jupyter/actions?query=workflow%3ATest)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/lucasrcezimbra/llm-jupyter/blob/main/LICENSE)
Run a IPython interpreter in the [LLM](https://github.com/simonw/llm) virtual environment
## Installation
Install this plugin in the same environment as [LLM](https://llm.datasette.io/).
```bash
pipx install llm
llm install llm-jupyter
```
## Usage
### IPython
This plugin adds a new `ipython` command to LLM. This executes IPython in the same virtual environment as LLM itself.
You can use this to check the Python version
```bash
llm ipython --version
# Should output '8.20.0' or similar
```
Or to start a IPython shell. In that shell you can import `llm` and use it to interact with models:
```bash
llm ipython
```
```python
In [1]: %llm 'Who are you?'
# LLM output will be set as the next input
In [2]: print("I am a Python programmer using Jupyter Notebook.")
```
https://github.com/lucasrcezimbra/llm-jupyter/assets/7042915/b7f8a9ec-d269-4b24-bac3-a01ad6802032
### Notebook
This plugin also adds a new `notebook` command to LLM. This executes a Jupyter Notebook in the same virtual environment as LLM itself.
```bash
llm notebook
```
```python
%load_ext llm_jupyter.magic
%llm 'Who are you?'
# LLM output will be set as the next input
print("I am a Python programmer using Jupyter Notebook.")
```
https://github.com/lucasrcezimbra/llm-jupyter/assets/7042915/58c63b2e-3a7b-43f1-b0aa-ab3daf2e9810
## Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
```bash
git clone git@github.com:lucasrcezimbra/llm-jupyter.git
cd llm-jupyter
python -m venv .venv
source .venv/bin/activate
pip install -e .[test]
```
Now install the dependencies and test dependencies:
```bash
llm install -e '.[test]'
```
To run the tests:
```bash
pytest
```
Raw data
{
"_id": null,
"home_page": null,
"name": "llm-jupyter",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Simon Willison",
"author_email": "Lucas Rangel Cezimbra <lucas@cezimbra.tec.br>",
"download_url": "https://files.pythonhosted.org/packages/07/24/15c601ee08bf8d2717a66ce71de751d01663a10292fee54a8ae90dc792c2/llm_jupyter-0.2.0.tar.gz",
"platform": null,
"description": "# llm-jupyter\n\n[![PyPI](https://img.shields.io/pypi/v/llm-jupyter.svg)](https://pypi.org/project/llm-jupyter/)\n[![Changelog](https://img.shields.io/github/v/release/lucasrcezimbra/llm-jupyter?include_prereleases&label=changelog)](https://github.com/lucasrcezimbra/llm-jupyter/releases)\n[![Tests](https://github.com/lucasrcezimbra/llm-jupyter/workflows/Test/badge.svg)](https://github.com/lucasrcezimbra/llm-jupyter/actions?query=workflow%3ATest)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/lucasrcezimbra/llm-jupyter/blob/main/LICENSE)\n\nRun a IPython interpreter in the [LLM](https://github.com/simonw/llm) virtual environment\n\n## Installation\n\nInstall this plugin in the same environment as [LLM](https://llm.datasette.io/).\n```bash\npipx install llm\nllm install llm-jupyter\n```\n## Usage\n\n### IPython\nThis plugin adds a new `ipython` command to LLM. This executes IPython in the same virtual environment as LLM itself.\n\nYou can use this to check the Python version\n\n```bash\nllm ipython --version\n# Should output '8.20.0' or similar\n```\n\nOr to start a IPython shell. In that shell you can import `llm` and use it to interact with models:\n```bash\nllm ipython\n```\n\n```python\nIn [1]: %llm 'Who are you?'\n\n# LLM output will be set as the next input\nIn [2]: print(\"I am a Python programmer using Jupyter Notebook.\")\n```\n\nhttps://github.com/lucasrcezimbra/llm-jupyter/assets/7042915/b7f8a9ec-d269-4b24-bac3-a01ad6802032\n\n\n### Notebook\nThis plugin also adds a new `notebook` command to LLM. This executes a Jupyter Notebook in the same virtual environment as LLM itself.\n\n```bash\nllm notebook\n```\n\n```python\n%load_ext llm_jupyter.magic\n\n%llm 'Who are you?'\n\n# LLM output will be set as the next input\nprint(\"I am a Python programmer using Jupyter Notebook.\")\n```\n\nhttps://github.com/lucasrcezimbra/llm-jupyter/assets/7042915/58c63b2e-3a7b-43f1-b0aa-ab3daf2e9810\n\n## Development\n\nTo set up this plugin locally, first checkout the code. Then create a new virtual environment:\n```bash\ngit clone git@github.com:lucasrcezimbra/llm-jupyter.git\ncd llm-jupyter\npython -m venv .venv\nsource .venv/bin/activate\npip install -e .[test]\n```\nNow install the dependencies and test dependencies:\n```bash\nllm install -e '.[test]'\n```\nTo run the tests:\n```bash\npytest\n```\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Run a IPython interpreter in the LLM virtual environment",
"version": "0.2.0",
"project_urls": {
"CI": "https://github.com/lucasrcezimbra/llm-jupyter/actions",
"Changelog": "https://github.com/lucasrcezimbra/llm-jupyter/releases",
"Homepage": "https://github.com/lucasrcezimbra/llm-jupyter",
"Issues": "https://github.com/lucasrcezimbra/llm-jupyter/issues"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b96a41c0ae199850175c25cb11d5bce54a8ff2c12ff9a525eaaedf2e2aa23053",
"md5": "6fa53683d450451582cc6ddcc7065e7f",
"sha256": "69da11d773fc6214b6c3a10c54c69f4f12b49d04864a7d5df013bd0419489d3e"
},
"downloads": -1,
"filename": "llm_jupyter-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6fa53683d450451582cc6ddcc7065e7f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 7857,
"upload_time": "2024-05-17T15:42:43",
"upload_time_iso_8601": "2024-05-17T15:42:43.249734Z",
"url": "https://files.pythonhosted.org/packages/b9/6a/41c0ae199850175c25cb11d5bce54a8ff2c12ff9a525eaaedf2e2aa23053/llm_jupyter-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "072415c601ee08bf8d2717a66ce71de751d01663a10292fee54a8ae90dc792c2",
"md5": "04fb20a6423374e47dda57411162e778",
"sha256": "4ed55370d6b78897497ae35a49c593e07e3f287c2f156b4dbb083604af071418"
},
"downloads": -1,
"filename": "llm_jupyter-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "04fb20a6423374e47dda57411162e778",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 7989,
"upload_time": "2024-05-17T15:42:45",
"upload_time_iso_8601": "2024-05-17T15:42:45.529272Z",
"url": "https://files.pythonhosted.org/packages/07/24/15c601ee08bf8d2717a66ce71de751d01663a10292fee54a8ae90dc792c2/llm_jupyter-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-17 15:42:45",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "lucasrcezimbra",
"github_project": "llm-jupyter",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "llm-jupyter"
}