Skip to content

Commit 4e18c2e

Browse files
author
Android-16
committed
feat: add Jupyter extension (Wave 1, Light-Heart-Labs#9 priority)
1 parent 0b51602 commit 4e18c2e

3 files changed

Lines changed: 118 additions & 0 deletions

File tree

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Jupyter Extension for Dream Server
2+
3+
## Overview
4+
5+
Jupyter Notebook is an open-source web application for creating and sharing computational documents. This extension provides a full-featured data science environment with Python, scipy stack, and GPU support.
6+
7+
## Features
8+
9+
- JupyterLab interface (modern, extensible)
10+
- Pre-installed: NumPy, Pandas, SciPy, Matplotlib, Scikit-learn
11+
- GPU acceleration support (CUDA-enabled)
12+
- Persistent storage for notebooks
13+
- Optional token-based authentication
14+
15+
## Usage
16+
17+
### Enable the extension
18+
19+
```bash
20+
dream extensions enable jupyter
21+
```
22+
23+
### Access Jupyter
24+
25+
```
26+
http://localhost:${JUPYTER_PORT:-8888}
27+
```
28+
29+
If `JUPYTER_TOKEN` is set, use it to log in. If empty (default), no authentication required.
30+
31+
### Set a custom token
32+
33+
Edit `.env`:
34+
35+
```
36+
JUPYTER_TOKEN=your-secret-token
37+
```
38+
39+
## Configuration
40+
41+
| Environment Variable | Default | Description |
42+
|---------------------|---------|-------------|
43+
| `JUPYTER_PORT` | 8888 | Web UI port |
44+
| `JUPYTER_TOKEN` | (empty) | Auth token (empty = no auth) |
45+
46+
## Integration
47+
48+
Jupyter connects to Dream Server's LLM API:
49+
- Use `${LLM_API_URL}` in notebooks for API calls
50+
- Query local models directly from Python code
51+
52+
Example:
53+
```python
54+
import requests
55+
56+
response = requests.post(f"{os.environ['LLM_API_URL']}/v1/chat/completions", ...)
57+
```
58+
59+
## Uninstall
60+
61+
```bash
62+
dream extensions disable jupyter
63+
```
64+
65+
Notebooks in `./data/jupyter/` are preserved.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: jupyter
2+
3+
services:
4+
jupyter:
5+
image: jupyter/scipy-notebook:notebook-7.3.3
6+
container_name: jupyter
7+
ports:
8+
- "${JUPYTER_PORT:-8888}:8888"
9+
volumes:
10+
- ./data/jupyter:/home/jovyan/work
11+
environment:
12+
- JUPYTER_ENABLE_LAB=yes
13+
- JUPYTER_TOKEN=${JUPYTER_TOKEN:-}
14+
- LLM_API_URL=${LLM_API_URL:-http://localhost:8000}
15+
restart: unless-stopped
16+
healthcheck:
17+
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8888/api"]
18+
interval: 30s
19+
timeout: 10s
20+
retries: 3
21+
start_period: 60s
22+
networks:
23+
- dream-network
24+
deploy:
25+
resources:
26+
reservations:
27+
devices:
28+
- driver: nvidia
29+
count: all
30+
capabilities: [gpu]
31+
32+
networks:
33+
dream-network:
34+
external: true
35+
name: dream-network
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: jupyter
2+
version: "1.0.0"
3+
description: Jupyter Notebook - Interactive data science and coding environment
4+
category: tool
5+
authors:
6+
- Project Jupyter
7+
website: https://jupyter.org/
8+
image: jupyter/scipy-notebook:notebook-7.3.3
9+
gpu: [amd, nvidia]
10+
port: 8888
11+
data:
12+
- ./data/jupyter:/home/jovyan/work
13+
healthcheck:
14+
- wget -q --spider http://localhost:8888/api
15+
env:
16+
- LLM_API_URL
17+
dependencies: []
18+
tags: [notebook, python, data-science, coding]

0 commit comments

Comments
 (0)