-
Notifications
You must be signed in to change notification settings - Fork 29
[HWORKS-1224] Add vLLM to docs and update outdated descriptions and images #425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 hidden or 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. | ||
javierdlrm marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.