SambaNova
LLM service implementation using SambaNova’s API with OpenAI-compatible interface
Overview
SambaNovaLLMService
provides access to SambaNova’s language models through an OpenAI-compatible interface.
It inherits from OpenAILLMService
and supports streaming responses, function calling, and context management.
Installation
To use SambaNovaLLMService
, install the required dependencies:
You also need to set up your SambaNova API key as an environment variable: SAMBANOVA_API_KEY
.
Get your SambaNova API key here.
Configuration
Constructor Parameters
Your SambaNova API key
Model identifier
SambaNova API endpoint
Input Parameters
Inherits OpenAI-compatible parameters:
Maximum number of tokens to generate. Must be greater than or equal to 1.
Controls randomness in the output. Range: [0.0, 1.0].
Controls diversity via nucleus sampling. Range: [0.0, 1.0]
Usage Example
Methods
See the LLM base class methods for additional functionality.
Function Calling
This service supports function calling (also known as tool calling) which allows the LLM to request information from external services and APIs. For example, you can enable your bot to:
- Check current weather conditions.
- Query databases.
- Access external APIs.
- Perform custom actions.
Function Calling Guide
Learn how to implement function calling with standardized schemas, register handlers, manage context properly, and control execution flow in your conversational AI applications.
Available Models
Model Name | Description |
---|---|
DeepSeek-R1 | deepseek-ai/DeepSeek-R1 |
DeepSeek-R1-Distill-Llama-70B | deepseek-ai/DeepSeek-R1-Distill-Llama-70B |
DeepSeek-V3-0324 | deepseek-ai/DeepSeek-V3-0324 |
Llama-4-Maverick-17B-128E-Instruct | meta-llama/Llama-4-Maverick-17B-128E-Instruct |
Llama-4-Scout-17B-16E-Instruct | meta-llama/Llama-4-Scout-17B-16E-Instruct |
Meta-Llama-3.3-70B-Instruct | meta-llama/Llama-3.3-70B-Instruct |
Meta-Llama-3.2-3B-Instruct | meta-llama/Llama-3.2-3B-Instruct |
Meta-Llama-3.2-1B-Instruct | meta-llama/Llama-3.2-1B-Instruct |
Meta-Llama-3.1-405B-Instruct | meta-llama/Llama-3.1-405B-Instruct |
Meta-Llama-3.1-8B-Instruct | meta-llama/Llama-3.1-8B-Instruct |
Meta-Llama-Guard-3-8B | meta-llama/Llama-Guard-3-8B |
QwQ-32B | Qwen/QwQ-32B |
Qwen3-32B | Qwen/Qwen3-32B |
Llama-3.3-Swallow-70B-Instruct-v0.4 | Tokyotech-llm/Llama-3.3-Swallow-70B-Instruct-v0.4 |
See SambaNova’s docs for a complete list of supported models.
Frame Flow
Inherits the OpenAI LLM Service frame flow:
Metrics Support
The service collects standard LLM metrics:
- Token usage (prompt and completion).
- Processing duration.
- Time to First Byte (TTFB).
- Function call metrics.
Notes
- OpenAI-compatible interface.
- Supports streaming responses.
- Handles function calling.
- Manages conversation context.
- Includes token usage tracking.
- Thread-safe processing.
- Automatic error handling.