Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/app/endpoints/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ def get_llama_stack_client(
) -> LlamaStackClient:
if llama_stack_config.use_as_library_client is True:
logger.info("Using Llama stack as library client")
client = LlamaStackAsLibraryClient("ollama")
client = LlamaStackAsLibraryClient(
llama_stack_config.library_client_config_path
)
client.initialize()
return client
else:
Expand Down
6 changes: 6 additions & 0 deletions src/models/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class LLamaStackConfiguration(BaseModel):
url: Optional[str] = None
api_key: Optional[str] = None
use_as_library_client: Optional[bool] = None
library_client_config_path: Optional[str] = None
chat_completion_mode: bool = False

@model_validator(mode="after")
Expand All @@ -25,6 +26,11 @@ def check_llama_stack_model(self) -> Self:
)
if self.use_as_library_client is None:
self.use_as_library_client = False
if self.use_as_library_client:
if self.library_client_config_path is None:
raise ValueError(
"LLama stack library client mode is enabled but a configuration file path is not specified"
)
return self


Expand Down