-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[HWORKS-1224] Add vLLM to docs and update outdated descriptions and i…
…mages
- Loading branch information
1 parent
2b978c7
commit 63b9831
Showing
31 changed files
with
744 additions
and
603 deletions.
There are no files selected for viewing
Binary file modified
BIN
+7.47 KB
(140%)
docs/assets/images/guides/mlops/serving/deployment_adv_form_batcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+15.4 KB
(120%)
docs/assets/images/guides/mlops/serving/deployment_adv_form_kserve.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.41 KB
(110%)
docs/assets/images/guides/mlops/serving/deployment_adv_form_logger.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-9.91 KB
(91%)
docs/assets/images/guides/mlops/serving/deployment_adv_form_trans.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+103 KB
(290%)
docs/assets/images/guides/mlops/serving/deployment_creating.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-41.6 KB
(40%)
docs/assets/images/guides/mlops/serving/deployment_grpc_select.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+24.5 KB
(150%)
docs/assets/images/guides/mlops/serving/deployment_simple_form_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-24.9 KB
(77%)
docs/assets/images/guides/mlops/serving/deployment_simple_form_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-7.79 KB
(92%)
docs/assets/images/guides/mlops/serving/deployment_simple_form_adv_options.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+22.5 KB
(130%)
docs/assets/images/guides/mlops/serving/deployment_simple_form_py_pred.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-5 KB
(96%)
docs/assets/images/guides/mlops/serving/deployment_simple_form_py_pred_env.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# How To Export a LLM Model | ||
|
||
## Introduction | ||
|
||
In this guide you will learn how to export a [Large Language Model (LLM)](https://www.hopsworks.ai/dictionary/llms-large-language-models) and register it in the Model Registry. | ||
|
||
## Code | ||
|
||
### Step 1: Connect to Hopsworks | ||
|
||
=== "Python" | ||
```python | ||
import hopsworks | ||
|
||
project = hopsworks.login() | ||
|
||
# get Hopsworks Model Registry handle | ||
mr = project.get_model_registry() | ||
``` | ||
|
||
### Step 2: Download the LLM | ||
|
||
Download your base or fine-tuned LLM. LLMs can typically be downloaded using the official frameworks provided by their creators (e.g., HuggingFace, Ollama, ...) | ||
|
||
=== "Python" | ||
```python | ||
# Download LLM (e.g., using huggingface to download Llama-3.1-8B base model) | ||
from huggingface_hub import snapshot_download | ||
|
||
model_dir = snapshot_download( | ||
"meta-llama/Llama-3.1-8B", | ||
ignore_patterns="original/*" | ||
) | ||
``` | ||
|
||
### Step 3: (Optional) Fine-tune LLM | ||
|
||
If necessary, fine-tune your LLM with an [instruction set](https://www.hopsworks.ai/dictionary/instruction-datasets-for-fine-tuning-llms). A LLM can be fine-tuned fully or using [Parameter Efficient Fine Tuning (PEFT)](https://www.hopsworks.ai/dictionary/parameter-efficient-fine-tuning-of-llms) methods such as LoRA or QLoRA. | ||
|
||
=== "Python" | ||
```python | ||
# Fine-tune LLM using PEFT (LoRA, QLoRA) or other methods | ||
model_dir = ... | ||
``` | ||
|
||
### Step 4: Register model in registry | ||
|
||
Use the `ModelRegistry.llm.create_model(..)` function to register a model as LLM. Define a name, and attach optional metrics for your model, then invoke the `save()` function with the parameter being the path to the local directory where the model was exported to. | ||
|
||
=== "Python" | ||
```python | ||
# Model evaluation metrics | ||
metrics = {'f1-score': 0.8, 'perplexity': 31.62, 'bleu-score': 0.73} | ||
|
||
llm_model = mr.llm.create_model("llm_model", metrics=metrics) | ||
|
||
llm_model.save(model_dir) | ||
``` | ||
|
||
## Going Further | ||
|
||
You can attach an [Input Example](../input_example.md) and a [Model Schema](../input_example.md) to your model to document the shape and type of the data the model was trained on. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.