mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-07-26 06:07:43 +00:00
- Add new Vertex AI remote inference provider with litellm integration - Support for Gemini models through Google Cloud Vertex AI platform - Uses Google Cloud Application Default Credentials (ADC) for authentication - Added VertexAI models: gemini-2.5-flash, gemini-2.5-pro, gemini-2.0-flash. - Updated provider registry to include vertexai provider - Updated starter template to support Vertex AI configuration - Added comprehensive documentation and sample configuration Signed-off-by: Eran Cohen <eranco@redhat.com>
36 lines
1.1 KiB
Python
36 lines
1.1 KiB
Python
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
# All rights reserved.
|
|
#
|
|
# This source code is licensed under the terms described in the LICENSE file in
|
|
# the root directory of this source tree.
|
|
|
|
from llama_stack.apis.models import ModelType
|
|
from llama_stack.providers.utils.inference.model_registry import (
|
|
ProviderModelEntry,
|
|
)
|
|
|
|
# Vertex AI model IDs with vertex_ai/ prefix as required by litellm
|
|
LLM_MODEL_IDS = [
|
|
"vertex_ai/gemini-2.0-flash",
|
|
"vertex_ai/gemini-2.5-flash",
|
|
"vertex_ai/gemini-2.5-pro",
|
|
]
|
|
|
|
SAFETY_MODELS_ENTRIES = list[ProviderModelEntry]()
|
|
|
|
MODEL_ENTRIES = (
|
|
[ProviderModelEntry(provider_model_id=m) for m in LLM_MODEL_IDS]
|
|
+ [
|
|
ProviderModelEntry(
|
|
provider_model_id="vertex_ai/text-embedding-004",
|
|
model_type=ModelType.embedding,
|
|
metadata={"embedding_dimension": 768, "context_length": 2048},
|
|
),
|
|
ProviderModelEntry(
|
|
provider_model_id="vertex_ai/text-embedding-005",
|
|
model_type=ModelType.embedding,
|
|
metadata={"embedding_dimension": 768, "context_length": 2048},
|
|
),
|
|
]
|
|
+ SAFETY_MODELS_ENTRIES
|
|
)
|