Skip to content

Commit 858c280

Browse files
committed
Document Sync by Tina
1 parent f62ef51 commit 858c280

File tree

7 files changed

+83
-4
lines changed

7 files changed

+83
-4
lines changed

docs/stable/cli/_category_.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"label": "ServerlessLLM CLI",
3+
"position": 4,
4+
"link": {
5+
"type": "generated-index",
6+
"description": "TODO"
7+
}
8+
}

docs/stable/dev/_category_.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"label": "Developer Guide",
3-
"position": 4,
3+
"position": 5,
44
"link": {
55
"type": "generated-index"
66
}
Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,26 @@
11
# Installations
2-
Todo
2+
3+
## Requirements
4+
- OS: Ubuntu 20.04
5+
- Python: 3.10
6+
- GPU: compute capability 7.0 or higher
7+
8+
## Install with pip
9+
TODO
10+
11+
## Install from source
12+
Install the package from source by running the following commands:
13+
```bash
14+
# Because this is currelty a private repository, you need to login to github first
15+
# by `gh auth login` and then clone the repository
16+
git clone https://github.com/future-xy/Phantom-component.git
17+
cd Phantom-component
18+
pip install -e .
19+
pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ serverless_llm_store==0.0.1.dev2
20+
```
21+
22+
# Install the package
23+
conda create -n sllm python=3.10 -y
24+
conda activate sllm
25+
pip install -e .[worker]
26+
```
Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,49 @@
11
# Quickstart Guide
2-
todo
2+
3+
This guide will help you get started with the basics of using ServerlessLLM. Please make sure you have installed the ServerlessLLM following the [installation guide](./installation.md).
4+
5+
## Local test
6+
First, let's start a local ray cluster to test the ServerlessLLM. You can start a local ray cluster by running the following command:
7+
8+
Start a local ray cluster with 1 head node and 1 worker node:
9+
```bash
10+
conda activate sllm
11+
ray start --head --port=6379 --num-cpus=4 --num-gpus=0 \
12+
--resources='{"control_node": 1}' --block
13+
```
14+
15+
In a new terminal, start the worker node:
16+
```bash
17+
conda activate sllm
18+
ray start --address=localhost:6379 --num-cpus=4 --num-gpus=2 \
19+
--resources='{"worker_node": 1, "worker_id_0": 1}' --block
20+
```
21+
22+
Now, start the ServerlessLLM server by running the following command in a new terminal:
23+
```bash
24+
conda activate sllm
25+
sllm-serve start
26+
```
27+
28+
Next, let's deploy a model to the ServerlessLLM server. You can deploy a model by running the following command:
29+
```bash
30+
conda activate sllm
31+
sllm-cli deploy --model facebook/opt-1.3b
32+
```
33+
34+
Now, you can query the model by any OpenAI API client. For example, you can use the following Python code to query the model:
35+
```bash
36+
curl http://localhost:8343/v1/chat/completions \
37+
-H "Content-Type: application/json" \
38+
-d '{
39+
"model": "opt-1.3b",
40+
"messages": [
41+
{"role": "system", "content": "You are a helpful assistant."},
42+
{"role": "user", "content": "What is your name?"}
43+
]
44+
}'
45+
```
46+
Expected output:
47+
```json
48+
{"id":"chatcmpl-9f812a40-6b96-4ef9-8584-0b8149892cb9","object":"chat.completion","created":1720021153,"model":"opt-1.3b","choices":[{"index":0,"message":{"role":"assistant","content":"system: You are a helpful assistant.\nuser: What is your name?\nsystem: I am a helpful assistant.\n"},"logprobs":null,"finish_reason":"stop"}],"usage":{"prompt_tokens":16,"completion_tokens":26,"total_tokens":42}}
49+
```

docs/stable/serving/_category_.json renamed to docs/stable/serve/_category_.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"label": "Serving",
2+
"label": "ServerlessLLM Serve",
33
"position": 3,
44
"link": {
55
"type": "generated-index",

0 commit comments

Comments
 (0)