Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
397eed9
Sambanova now using LiteLLM openai-compat, models and template updated
jhpiedrahitao Mar 12, 2025
e49bcd4
Merge branch 'meta-llama:main' into feat/litellm_sambanova_usage
jhpiedrahitao Mar 12, 2025
bed93ec
update dev template
jhpiedrahitao Mar 12, 2025
716cb09
Merge branch 'meta-llama:main' into feat/litellm_sambanova_usage
jhpiedrahitao Mar 17, 2025
8f9c791
Merge branch 'meta-llama:main' into feat/litellm_sambanova_usage
jhpiedrahitao Mar 17, 2025
0f68852
fix contentype dicts into lists
jhpiedrahitao Mar 18, 2025
5bd1bd3
Merge branch 'main' into feat/litellm_sambanova_usage
jhpiedrahitao Mar 18, 2025
43d6c6f
update run template
jhpiedrahitao Mar 18, 2025
c2c27a7
overload _get_parms, to download url images in message conversion
jhpiedrahitao Mar 19, 2025
02a4f9a
Merge branch 'main' into feat/litellm_sambanova_usage
jhpiedrahitao Mar 19, 2025
6bb64b0
update tests to skip providers not supporting json schema structured …
jhpiedrahitao Mar 20, 2025
8783dd8
Merge branch 'main' into feat/litellm_sambanova_usage
jhpiedrahitao Mar 24, 2025
9c9f957
Merge branch 'main' into feat/litellm_sambanova_usage
jhpiedrahitao Apr 1, 2025
3372301
add litellm api_base param
jhpiedrahitao Apr 1, 2025
085cc7b
update get_apikey in adaptor get_params
jhpiedrahitao Apr 2, 2025
ec73b3d
Merge branch 'main' into feat/litellm_sambanova_usage
jhpiedrahitao Apr 7, 2025
49bf421
Merge branch 'main' into feat/litellm_sambanova_usage
jhpiedrahitao Apr 8, 2025
ecf84a3
fix typo un sambanova llama4 scout model name
jhpiedrahitao Apr 8, 2025
8e6b622
add llama4 maverick to sambanova inference models
jhpiedrahitao Apr 8, 2025
aff9e18
Merge branch 'meta-llama:main' into feat/litellm_sambanova_usage
jhpiedrahitao Apr 8, 2025
13c660f
Merge branch 'meta-llama:main' into feat/litellm_sambanova_usage
jhpiedrahitao Apr 10, 2025
172a918
Merge branch 'main' into feat/litellm_sambanova_usage
jhpiedrahitao Apr 12, 2025
dd808a8
Merge branch 'meta-llama:main' into feat/litellm_sambanova_usage
jhpiedrahitao Apr 14, 2025
488eb8f
Merge branch 'main' into feat/litellm_sambanova_usage
jhpiedrahitao Apr 14, 2025
63e3c58
update sambanova models
jhpiedrahitao Apr 15, 2025
daf0c26
Merge remote-tracking branch 'refs/remotes/origin/feat/litellm_samban…
jhpiedrahitao Apr 15, 2025
b7f16ac
Merge branch 'main' into feat/litellm_sambanova_usage
jhpiedrahitao May 5, 2025
c4add97
rm inline code_tool
jhpiedrahitao May 5, 2025
2867983
Merge branch 'main' into feat/litellm_sambanova_usage
jhpiedrahitao May 5, 2025
21125f7
Merge branch 'main' into feat/litellm_sambanova_usage
jhpiedrahitao May 6, 2025
f149d6a
Merge branch 'main' into feat/litellm_sambanova_usage
jhpiedrahitao May 6, 2025
d42a9ea
Merge branch 'main' into feat/litellm_sambanova_usage
jhpiedrahitao May 6, 2025
f592408
fix typo
jhpiedrahitao May 6, 2025
c91c457
Merge branch 'main' into feat/litellm_sambanova_usage
jhpiedrahitao May 6, 2025
05e2fa0
Merge branch 'main' into feat/litellm_sambanova_usage
jhpiedrahitao May 6, 2025
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
26 changes: 13 additions & 13 deletions docs/source/distributions/self_hosted_distro/sambanova.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ The `llamastack/distribution-sambanova` distribution consists of the following p
| API | Provider(s) |
|-----|-------------|
| agents | `inline::meta-reference` |
| inference | `remote::sambanova` |
| inference | `remote::sambanova`, `inline::sentence-transformers` |
| safety | `inline::llama-guard` |
| telemetry | `inline::meta-reference` |
| tool_runtime | `remote::brave-search`, `remote::tavily-search`, `inline::rag-runtime` |
| tool_runtime | `remote::brave-search`, `remote::tavily-search`, `inline::rag-runtime`, `remote::model-context-protocol`, `remote::wolfram-alpha` |
| vector_io | `inline::faiss`, `remote::chromadb`, `remote::pgvector` |


Expand All @@ -28,22 +28,22 @@ The `llamastack/distribution-sambanova` distribution consists of the following p
The following environment variables can be configured:

- `LLAMASTACK_PORT`: Port for the Llama Stack distribution server (default: `8321`)
- `SAMBANOVA_API_KEY`: SambaNova.AI API Key (default: ``)
- `SAMBANOVA_API_KEY`: SambaNova API Key (default: ``)

### Models

The following models are available by default:

- `Meta-Llama-3.1-8B-Instruct (aliases: meta-llama/Llama-3.1-8B-Instruct)`
- `Meta-Llama-3.1-70B-Instruct (aliases: meta-llama/Llama-3.1-70B-Instruct)`
- `Meta-Llama-3.1-405B-Instruct (aliases: meta-llama/Llama-3.1-405B-Instruct-FP8)`
- `Meta-Llama-3.2-1B-Instruct (aliases: meta-llama/Llama-3.2-1B-Instruct)`
- `Meta-Llama-3.2-3B-Instruct (aliases: meta-llama/Llama-3.2-3B-Instruct)`
- `Meta-Llama-3.3-70B-Instruct (aliases: meta-llama/Llama-3.3-70B-Instruct)`
- `Llama-3.2-11B-Vision-Instruct (aliases: meta-llama/Llama-3.2-11B-Vision-Instruct)`
- `Llama-3.2-90B-Vision-Instruct (aliases: meta-llama/Llama-3.2-90B-Vision-Instruct)`
- `Meta-Llama-Guard-3-8B (aliases: meta-llama/Llama-Guard-3-8B)`
- `Llama-4-Scout-17B-16E-Instruct (aliases: meta-llama/Llama-4-Scout-17B-16E-Instruct)`
- `sambanova/Meta-Llama-3.1-8B-Instruct (aliases: meta-llama/Llama-3.1-8B-Instruct)`
- `sambanova/Meta-Llama-3.1-405B-Instruct (aliases: meta-llama/Llama-3.1-405B-Instruct-FP8)`
- `sambanova/Meta-Llama-3.2-1B-Instruct (aliases: meta-llama/Llama-3.2-1B-Instruct)`
- `sambanova/Meta-Llama-3.2-3B-Instruct (aliases: meta-llama/Llama-3.2-3B-Instruct)`
- `sambanova/Meta-Llama-3.3-70B-Instruct (aliases: meta-llama/Llama-3.3-70B-Instruct)`
- `sambanova/Llama-3.2-11B-Vision-Instruct (aliases: meta-llama/Llama-3.2-11B-Vision-Instruct)`
- `sambanova/Llama-3.2-90B-Vision-Instruct (aliases: meta-llama/Llama-3.2-90B-Vision-Instruct)`
- `sambanova/Llama-4-Scout-17B-16E-Instruct (aliases: meta-llama/Llama-4-Scout-17B-16E-Instruct)`
- `sambanova/Llama-4-Maverick-17B-128E-Instruct (aliases: meta-llama/Llama-4-Maverick-17B-128E-Instruct)`
- `sambanova/Meta-Llama-Guard-3-8B (aliases: meta-llama/Llama-Guard-3-8B)`


### Prerequisite: API Keys
Expand Down
5 changes: 2 additions & 3 deletions llama_stack/providers/registry/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,10 @@ def available_providers() -> list[ProviderSpec]:
api=Api.inference,
adapter=AdapterSpec(
adapter_type="sambanova",
pip_packages=[
"openai",
],
pip_packages=["litellm"],
module="llama_stack.providers.remote.inference.sambanova",
config_class="llama_stack.providers.remote.inference.sambanova.SambaNovaImplConfig",
provider_data_validator="llama_stack.providers.remote.inference.sambanova.config.SambaNovaProviderDataValidator",
),
),
remote_provider_spec(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@
# This source code is licensed under the terms described in the LICENSE file in
# the root directory of this source tree.

from pydantic import BaseModel
from llama_stack.apis.inference import Inference

from .config import SambaNovaImplConfig


class SambaNovaProviderDataValidator(BaseModel):
sambanova_api_key: str


async def get_adapter_impl(config: SambaNovaImplConfig, _deps):
async def get_adapter_impl(config: SambaNovaImplConfig, _deps) -> Inference:
from .sambanova import SambaNovaInferenceAdapter

assert isinstance(config, SambaNovaImplConfig), f"Unexpected config type: {type(config)}"
Expand Down
17 changes: 12 additions & 5 deletions llama_stack/providers/remote/inference/sambanova/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,32 @@

from typing import Any

from pydantic import BaseModel, Field
from pydantic import BaseModel, Field, SecretStr

from llama_stack.schema_utils import json_schema_type


class SambaNovaProviderDataValidator(BaseModel):
sambanova_api_key: str | None = Field(
default=None,
description="Sambanova Cloud API key",
)


@json_schema_type
class SambaNovaImplConfig(BaseModel):
url: str = Field(
default="https://api.sambanova.ai/v1",
description="The URL for the SambaNova AI server",
)
api_key: str | None = Field(
api_key: SecretStr | None = Field(
default=None,
description="The SambaNova.ai API Key",
description="The SambaNova cloud API Key",
)

@classmethod
def sample_run_config(cls, **kwargs) -> dict[str, Any]:
def sample_run_config(cls, api_key: str = "${env.SAMBANOVA_API_KEY}", **kwargs) -> dict[str, Any]:
return {
"url": "https://api.sambanova.ai/v1",
"api_key": "${env.SAMBANOVA_API_KEY}",
"api_key": api_key,
}
30 changes: 15 additions & 15 deletions llama_stack/providers/remote/inference/sambanova/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,43 +11,43 @@

MODEL_ENTRIES = [
build_hf_repo_model_entry(
"Meta-Llama-3.1-8B-Instruct",
"sambanova/Meta-Llama-3.1-8B-Instruct",
CoreModelId.llama3_1_8b_instruct.value,
),
build_hf_repo_model_entry(
"Meta-Llama-3.1-70B-Instruct",
CoreModelId.llama3_1_70b_instruct.value,
),
build_hf_repo_model_entry(
"Meta-Llama-3.1-405B-Instruct",
"sambanova/Meta-Llama-3.1-405B-Instruct",
CoreModelId.llama3_1_405b_instruct.value,
),
build_hf_repo_model_entry(
"Meta-Llama-3.2-1B-Instruct",
"sambanova/Meta-Llama-3.2-1B-Instruct",
CoreModelId.llama3_2_1b_instruct.value,
),
build_hf_repo_model_entry(
"Meta-Llama-3.2-3B-Instruct",
"sambanova/Meta-Llama-3.2-3B-Instruct",
CoreModelId.llama3_2_3b_instruct.value,
),
build_hf_repo_model_entry(
"Meta-Llama-3.3-70B-Instruct",
"sambanova/Meta-Llama-3.3-70B-Instruct",
CoreModelId.llama3_3_70b_instruct.value,
),
build_hf_repo_model_entry(
"Llama-3.2-11B-Vision-Instruct",
"sambanova/Llama-3.2-11B-Vision-Instruct",
CoreModelId.llama3_2_11b_vision_instruct.value,
),
build_hf_repo_model_entry(
"Llama-3.2-90B-Vision-Instruct",
"sambanova/Llama-3.2-90B-Vision-Instruct",
CoreModelId.llama3_2_90b_vision_instruct.value,
),
build_hf_repo_model_entry(
"Meta-Llama-Guard-3-8B",
CoreModelId.llama_guard_3_8b.value,
"sambanova/Llama-4-Scout-17B-16E-Instruct",
CoreModelId.llama4_scout_17b_16e_instruct.value,
),
build_hf_repo_model_entry(
"Llama-4-Scout-17B-16E-Instruct",
CoreModelId.llama4_scout_17b_16e_instruct.value,
"sambanova/Llama-4-Maverick-17B-128E-Instruct",
CoreModelId.llama4_maverick_17b_128e_instruct.value,
),
build_hf_repo_model_entry(
"sambanova/Meta-Llama-Guard-3-8B",
CoreModelId.llama_guard_3_8b.value,
),
]
Loading