chore: standardize model not found error (#2964)

# What does this PR do?
1. Creates a new `ModelNotFoundError` class
2. Implements the new class where appropriate 

Relates to #2379

Signed-off-by: Nathan Weinberg <nweinber@redhat.com>
This commit is contained in:
Nathan Weinberg 2025-07-30 15:19:53 -04:00 committed by GitHub
parent 266e2afb9c
commit c5622c79de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 23 additions and 10 deletions

View file

@ -15,6 +15,7 @@ from pathlib import Path
import fire
from llama_stack.apis.common.errors import ModelNotFoundError
from llama_stack.models.llama.llama3.generation import Llama3
from llama_stack.models.llama.llama4.generation import Llama4
from llama_stack.models.llama.sku_list import resolve_model
@ -34,7 +35,7 @@ def run_main(
llama_model = resolve_model(model_id)
if not llama_model:
raise ValueError(f"Model {model_id} not found")
raise ModelNotFoundError(model_id)
cls = Llama4 if llama4 else Llama3
generator = cls.build(