Skip to content

Commit

Permalink
Document Sync by Tina
Browse files Browse the repository at this point in the history
  • Loading branch information
Chivier committed Jul 22, 2024
1 parent 3a58929 commit 3ecd120
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 32 deletions.
59 changes: 30 additions & 29 deletions docs/stable/cli/SLLM-CLI Documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,35 @@ Before using the `sllm-cli` commands, you need to start the ServerlessLLM cluste

After setting up the ServerlessLLM cluster, you can use the commands listed below to manage and interact with your models.

### Example Workflow

1. **Deploy a Model**
> Deploy a model using the model name, which must be a huggingface pretrained model name. i.e. "facebook/opt-1.3b" instead of "opt-1.3b".
```bash
sllm-cli deploy --model facebook/opt-1.3b
```

2. **Generate Output**
```bash
echo '{
"model": "facebook/opt-1.3b",
"messages": [
{
"role": "user",
"content": "Please introduce yourself."
}
],
"temperature": 0.7,
"max_tokens": 50
}' > input.json
sllm-cli generate input.json
```

3. **Delete a Model**
```bash
sllm-cli delete facebook/opt-1.3b
```

### sllm-cli deploy
Deploy a model using a configuration file or model name.

Expand All @@ -23,7 +52,7 @@ sllm-cli deploy [OPTIONS]

##### Options
- `--model <model_name>`
- Model name to deploy with default configuration.
- Model name to deploy with default configuration. The model name must be a huggingface pretrained model name. You can find the list of available models [here](https://huggingface.co/models).

- `--config <config_path>`
- Path to the JSON configuration file.
Expand Down Expand Up @@ -150,31 +179,3 @@ sllm-cli update [OPTIONS]
sllm-cli update --model facebook/opt-1.3b
sllm-cli update --config /path/to/config.json
```

### Example Workflow

1. **Deploy a Model**
```bash
sllm-cli deploy --model facebook/opt-1.3b
```

2. **Generate Output**
```bash
echo '{
"model": "facebook/opt-1.3b",
"messages": [
{
"role": "user",
"content": "Please introduce yourself."
}
],
"temperature": 0.7,
"max_tokens": 50
}' > input.json
sllm-cli generate input.json
```

3. **Delete a Model**
```bash
sllm-cli delete facebook/opt-1.3b
```
1 change: 0 additions & 1 deletion docs/stable/cli/getting_started.md

This file was deleted.

17 changes: 16 additions & 1 deletion docs/stable/getting_started/docker_quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export LLM_SERVER_URL=http://localhost:8343/
Deploy a model to the ServerlessLLM server using the `sllm-cli`:

```bash
sllm-cli deploy --model "facebook/opt-2.7b"
sllm-cli deploy --model facebook/opt-2.7b
```
> Note: This command will spend some time downloading the model from the Hugging Face Model Hub.
> You can use any model from the [Hugging Face Model Hub](https://huggingface.co/models) by specifying the model name in the `--model` argument.
Expand Down Expand Up @@ -134,6 +134,21 @@ Expected output:
{"id":"chatcmpl-8b4773e9-a98b-41db-8163-018ed3dc65e2","object":"chat.completion","created":1720183759,"model":"facebook/opt-2.7b","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}}%
```

### Deleting a Model
To delete a deployed model, use the following command:

```bash
sllm-cli delete facebook/opt-1.3b
```

This will remove the specified model from the ServerlessLLM server.

You can also remove several models at once by providing multiple model names separated by spaces:

```bash
sllm-cli delete facebook/opt-1.3b facebook/opt-2.7b
```

### Cleanup

If you need to stop and remove the containers, you can use the following commands:
Expand Down
16 changes: 15 additions & 1 deletion docs/stable/getting_started/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,18 @@ curl http://localhost:8343/v1/chat/completions \
Expected output:
```json
{"id":"chatcmpl-9f812a40-6b96-4ef9-8584-0b8149892cb9","object":"chat.completion","created":1720021153,"model":"facebook/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}}
```
```

To delete a deployed model, use the following command:

```bash
sllm-cli delete facebook/opt-1.3b
```

This will remove the specified model from the ServerlessLLM server.

You can also remove several models at once by providing multiple model names separated by spaces:

```bash
sllm-cli delete facebook/opt-1.3b facebook/opt-2.7b
```

0 comments on commit 3ecd120

Please sign in to comment.