Skip to content

Commit 308338e

Browse files
committed
Update Docs
1 parent 9778de5 commit 308338e

27 files changed

Lines changed: 18043 additions & 0 deletions

.github/workflows/deploy.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: false
17+
18+
jobs:
19+
build:
20+
name: Build
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
27+
- uses: actions/setup-node@v4
28+
with:
29+
node-version: 20
30+
cache: npm
31+
32+
- name: Install dependencies
33+
run: npm ci
34+
35+
- name: Build website
36+
run: npm run build
37+
38+
- name: Upload Build Artifact
39+
uses: actions/upload-pages-artifact@v3
40+
with:
41+
path: build
42+
43+
deploy:
44+
name: Deploy
45+
needs: build
46+
runs-on: ubuntu-latest
47+
environment:
48+
name: github-pages
49+
url: ${{ steps.deployment.outputs.page_url }}
50+
steps:
51+
- name: Deploy to GitHub Pages
52+
id: deployment
53+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Dependencies
2+
node_modules/
3+
4+
# Build output
5+
build/
6+
.docusaurus/
7+
8+
# Environment
9+
.env
10+
.env.local
11+
12+
# OS
13+
.DS_Store

babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3+
};
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
id: installation
3+
title: Installation
4+
sidebar_label: Installation
5+
---
6+
7+
# Installation
8+
9+
This guide covers installing ContextPilot and its dependencies.
10+
11+
## Requirements
12+
13+
- Python >= 3.10
14+
- CUDA 12.x (for GPU-accelerated distance computation)
15+
- An inference engine: [SGLang](https://github.com/sgl-project/sglang), [vLLM](https://github.com/vllm-project/vllm), or any OpenAI-compatible server
16+
17+
## Install ContextPilot
18+
19+
```bash
20+
pip install contextpilot
21+
```
22+
23+
Or from source (development):
24+
```bash
25+
git clone https://github.com/EfficientContext/ContextPilot.git
26+
cd ContextPilot
27+
pip install -e .
28+
python -m contextpilot.install_hook # one-time: enables automatic SGLang + vLLM hooks
29+
```
30+
31+
This installs the core dependencies:
32+
33+
| Package | Purpose |
34+
|---------|--------|
35+
| `fastapi[all]` | HTTP server |
36+
| `aiohttp` | Async inference engine proxy |
37+
| `scipy` | Hierarchical clustering |
38+
| `transformers` | Tokenizer / chat templates |
39+
| `cupy-cuda12x` | GPU distance computation |
40+
| `elasticsearch` | BM25 retriever (optional) |
41+
| `datasets` | Loading benchmark datasets |
42+
43+
## Install an Inference Engine
44+
45+
**SGLang:**
46+
```bash
47+
pip install "sglang>=0.5"
48+
```
49+
50+
**vLLM:**
51+
```bash
52+
pip install vllm
53+
```
54+
55+
Both engines are supported via zero-patch runtime hooks — just set `CONTEXTPILOT_INDEX_URL` when launching. See [Online Usage Guide](../guides/online_usage#inference-engine-integration).
56+
57+
## Distributed Setup
58+
59+
If the ContextPilot index server and the inference engine run in **separate Python environments** (e.g., different virtualenvs or containers), the engine environment won't have the `contextpilot` package. Use the standalone hook instead:
60+
61+
```bash
62+
# In the engine's Python environment (one command, no clone needed):
63+
pip install requests
64+
curl -sL https://raw.githubusercontent.com/EfficientContext/ContextPilot/main/contextpilot/install_standalone.py | python -
65+
```
66+
67+
The installer downloads the hook from GitHub and installs it into site-packages. No `contextpilot` clone or install needed — just `requests` as a runtime dependency.
68+
69+
## Verify Installation
70+
71+
```bash
72+
python -c "import contextpilot; print('ContextPilot', contextpilot.__version__)"
73+
```

0 commit comments

Comments
 (0)