An agent to bring cluster kernel to local
Project description
Jupyter Kernel Agent
Jupyter Kernel Agent lets you run Jupyter code remotely by forwarding code to an HTTP endpoint and streaming results back in Jupyter’s native format.
Connect your Jupyter environment to clusters, GPU servers, or any backend that implements the Kernel Agent API.
Features
- 📡 Remote code execution over HTTP
- 🔑 Bearer token authentication
- 🖥️ Multiple backends (one kernel per endpoint)
- 🔄 Built-in magics for session management:
%reset— clear remote namespace / start new session%shutdown— shut down remote session%welcome— show kernel info%reconnect— reconnect after disconnect
- 🛑 Disconnection handling: hold (default) or exit
Installation
pip install jupyter-kernel-agent
This provides two CLI tools:
agent-server— run the FastAPI backend for code executionkernel_agent— manage Jupyter kernelspecs (install/list/delete)
Running the Server
Start the server with an API key:
agent-server --host 0.0.0.0 --port 8000 --api_key SECRET123
Test with curl:
curl -sX POST http://127.0.0.1:8000/kernel \
-H "Authorization: Bearer SECRET123" \
-H "Content-Type: application/json" \
-d '{"action":"execute","session_id":"s1","code":"1+1","execution_count":1}'
Expected response:
{"ok":true,"outputs":[{"type":"execute_result","data":{"text/plain":"2"},"execution_count":1,"metadata":{}}]}
Installing a Jupyter Kernel
Install a kernel that connects to your server:
kernel_agent install \
--endpoint http://127.0.0.1:8000/kernel \
--name local \
--api_key SECRET123 --user
List installed kernels:
kernel_agent list
You should see your new kernel listed and available in Jupyter.
System-wide Installation
To install for all users (e.g., JupyterHub):
sudo kernel_agent install \
--endpoint http://127.0.0.1:8000/kernel \
--name cluster \
--api_key SECRET123 \
--sys-prefix
Or specify a custom prefix:
sudo kernel_agent install \
--endpoint http://127.0.0.1:8000/kernel \
--name cluster \
--api_key SECRET123 \
--prefix /usr/local
Verify with:
jupyter kernelspec list
Usage in Notebooks
After installation, select your kernel (e.g., local or cluster) in Jupyter and run code as usual:
1+1
!uname -a
%reset
Outputs will be returned from the remote server.
License
Apache-2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jupyter_kernel_agent-1.2.0.tar.gz.
File metadata
- Download URL: jupyter_kernel_agent-1.2.0.tar.gz
- Upload date:
- Size: 19.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e940d045dbf2c9275b71f95f866b1ada8f323f969db9f1025530ad480092f119
|
|
| MD5 |
d1d48373ba94b1dabe57491af40044bc
|
|
| BLAKE2b-256 |
b88c8d8886c7972dc553839765b216c9d81537f988371207017e9f4fcfc32e9f
|
File details
Details for the file jupyter_kernel_agent-1.2.0-py3-none-any.whl.
File metadata
- Download URL: jupyter_kernel_agent-1.2.0-py3-none-any.whl
- Upload date:
- Size: 24.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21c5c6ab6f6b99a1cb367fb6b52a8f6c89bf30af1b8e37d758711b2f03408272
|
|
| MD5 |
6ff27aa81e1fc66631d8be639f86a27d
|
|
| BLAKE2b-256 |
8904332ec2dd3fef100156fea785092bb095b8280fd484cf53af43d66d98fa7f
|