@@ -79,62 +79,96 @@ classes in their code.
79
79
80
80
## Installation
81
81
82
- ### Installation via ` pip `
82
+ ### Setup: creating a Jupyter AI environment (recommended)
83
83
84
- To install the JupyterLab extension, you can run:
84
+ Before installing Jupyter AI, we highly recommend first creating a separate
85
+ Conda environment for Jupyter AI. This prevents the installation process from
86
+ clobbering Python packages in your existing Python environment.
85
87
86
- ```
87
- pip install jupyter-ai
88
- ```
88
+ To do so, install
89
+ [ conda] ( https://conda.io/projects/conda/en/latest/user-guide/install/index.html )
90
+ and create an environment that uses Python 3.12 and the latest version of
91
+ JupyterLab:
89
92
90
- You may need to install third-party packages, for example, to use some model providers and some file formats with Jupyter AI. To handle all supported use cases, you can install every dependency, which will give you access to all models currently supported by ` jupyter-ai ` . To install every dependency, run the following command, and then restart JupyterLab:
93
+ $ conda create -n jupyter-ai python=3.12 jupyterlab
94
+ $ conda activate jupyter-ai
91
95
92
- ```
93
- pip install jupyter-ai[all]
94
- ```
96
+ You can now choose how to install Jupyter AI.
95
97
96
- The latest major version of ` jupyter-ai ` , v2, only supports JupyterLab 4. If you
97
- need support for JupyterLab 3, you should install ` jupyter-ai ` v1 instead:
98
+ We offer 3 different ways to install Jupyter AI. You can read through each
99
+ section to pick the installation method that works best for you.
98
100
99
- ```
100
- pip install jupyter-ai~=1.0
101
- `` `
101
+ 1 . Quick installation via ` pip ` (recommended)
102
+ 2 . Minimal installation via ` pip `
103
+ 3 . Minimal installation via ` conda `
102
104
103
- If you are not using JupyterLab and you only want to install the Jupyter AI ` %%ai ` magic, you can run:
105
+ ### Quick installation via ` pip ` (recommended)
104
106
105
- ```
106
- $ pip install jupyter-ai-magics
107
- ```
107
+ If you want to install both the ` %%ai ` magic and the JupyterLab extension, you can run:
108
+
109
+ $ pip install jupyter-ai[all]
110
+
111
+ Then, restart JupyterLab. This will install every optional dependency, which
112
+ provides access to all models currently supported by ` jupyter-ai ` .
113
+
114
+ If you are not using JupyterLab and you only want to install the Jupyter AI
115
+ ` %%ai ` magic, you can run:
116
+
117
+ $ pip install jupyter-ai-magics[all]
108
118
109
119
` jupyter-ai ` depends on ` jupyter-ai-magics ` , so installing ` jupyter-ai `
110
120
automatically installs ` jupyter-ai-magics ` .
111
121
112
- ### Installation via ` pip ` or ` conda ` in a Conda environment (recommended)
122
+ ### Minimal installation via ` pip `
113
123
114
- We highly recommend installing both JupyterLab and Jupyter AI within an isolated
115
- Conda environment to avoid clobbering Python packages in your existing Python
116
- environment.
124
+ Most model providers in Jupyter AI require a specific dependency to be installed
125
+ before they are available for use. These are called _ provider dependencies_ .
126
+ Provider dependencies are optional to Jupyter AI, meaning that Jupyter AI can be
127
+ installed with or without any provider dependencies installed. If a provider
128
+ requires a dependency that is not installed, its models are not listed in the
129
+ user interface which allows you to select a language model.
117
130
118
- First, install
119
- [ conda] ( https://conda.io/projects/conda/en/latest/user-guide/install/index.html )
120
- and create an environment that uses Python 3.12:
131
+ To perform a minimal installation via ` pip ` without any provider dependencies,
132
+ omit the ` [all] ` optional dependency group from the package name:
121
133
122
- $ conda create -n jupyter-ai python=3.12
123
- $ conda activate jupyter-ai
134
+ ```
135
+ pip install jupyter-ai
136
+ ```
137
+
138
+ By selectively installing provider dependencies, you can control which models
139
+ are available in your Jupyter AI environment.
140
+
141
+ For example, to install Jupyter AI with only added support for Anthropic models, run:
124
142
125
- Then, use ` conda ` to install JupyterLab and Jupyter AI in this Conda environment.
143
+ ```
144
+ pip install jupyter-ai langchain-anthropic
145
+ ```
146
+
147
+ For more information on model providers and which dependencies they require, see
148
+ [ the model provider table] ( https://jupyter-ai.readthedocs.io/en/latest/users/index.html#model-providers ) .
149
+
150
+ ### Minimal installation via ` conda `
151
+
152
+ As an alternative to using ` pip ` , you can install ` jupyter-ai ` using
153
+ [ Conda] ( https://conda.io/projects/conda/en/latest/user-guide/install/index.html )
154
+ from the ` conda-forge ` channel:
126
155
127
- $ conda install -c conda-forge jupyter-ai # or,
128
156
$ conda install conda-forge::jupyter-ai
129
157
130
- When starting JupyterLab with Jupyter AI, make sure to activate the Conda
131
- environment first:
158
+ Most model providers in Jupyter AI require a specific _ provider dependency_ to
159
+ be installed before they are available for use. Provider dependencies are
160
+ not installed when installing ` jupyter-ai ` from Conda Forge, and should be
161
+ installed separately as needed.
162
+
163
+ For example, to install Jupyter AI with only added support for OpenAI models, run:
132
164
133
165
```
134
- conda activate jupyter-ai
135
- jupyter lab
166
+ conda install conda-forge::jupyter-ai conda-forge::langchain-openai
136
167
```
137
168
169
+ For more information on model providers and which dependencies they require, see
170
+ [ the model provider table] ( https://jupyter-ai.readthedocs.io/en/latest/users/index.html#model-providers ) .
171
+
138
172
## Uninstallation
139
173
140
174
If you installed Jupyter AI using ` pip ` , to remove the extension, run:
0 commit comments