llama-stack-mirror/tests/unit/providers/nvidia
Jash Gulabrai 1a770cf8ac
fix: Pass model parameter as config name to NeMo Customizer (#2218)
# What does this PR do?
When launching a fine-tuning job, an upcoming version of NeMo Customizer
will expect the `config` name to be formatted as
`namespace/name@version`. Here, `config` is a reference to a model +
additional metadata. There could be multiple `config`s that reference
the same base model.

This PR updates NVIDIA's `supervised_fine_tune` to simply pass the
`model` param as-is to NeMo Customizer. Currently, it expects a
specific, allowlisted llama model (i.e. `meta/Llama3.1-8B-Instruct`) and
converts it to the provider format (`meta/llama-3.1-8b-instruct`).

[//]: # (If resolving an issue, uncomment and update the line below)
[//]: # (Closes #[issue-number])

## Test Plan
From a notebook, I built an image with my changes: 
```
!llama stack build --template nvidia --image-type venv
from llama_stack.distribution.library_client import LlamaStackAsLibraryClient

client = LlamaStackAsLibraryClient("nvidia")
client.initialize()
```
And could successfully launch a job:
```
response = client.post_training.supervised_fine_tune(
    job_uuid="",
    model="meta/llama-3.2-1b-instruct@v1.0.0+A100", # Model passed as-is to Customimzer
    ...
)

job_id = response.job_uuid
print(f"Created job with ID: {job_id}")

Output:
Created job with ID: cust-Jm4oGmbwcvoufaLU4XkrRU
```

[//]: # (## Documentation)

---------

Co-authored-by: Jash Gulabrai <jgulabrai@nvidia.com>
2025-05-20 09:51:39 -07:00
..
__init__.py feat: Add nemo customizer (#1448) 2025-03-25 11:01:10 -07:00
conftest.py chore: re-enable isort enforcement (#1802) 2025-03-26 15:22:17 -07:00
test_datastore.py feat: Add NVIDIA NeMo datastore (#1852) 2025-04-28 09:41:59 -07:00
test_eval.py feat: Add NVIDIA Eval integration (#1890) 2025-04-24 17:12:42 -07:00
test_parameters.py fix: Pass model parameter as config name to NeMo Customizer (#2218) 2025-05-20 09:51:39 -07:00
test_safety.py fix: Fix messages format in NVIDIA safety check request body (#2063) 2025-04-30 18:01:28 +02:00
test_supervised_fine_tuning.py fix: Pass model parameter as config name to NeMo Customizer (#2218) 2025-05-20 09:51:39 -07:00