Package Exports
- sambanova-ai-provider
- sambanova-ai-provider/dist/index.js
- sambanova-ai-provider/dist/index.mjs
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sambanova-ai-provider) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
sambanova-ai-provider
Vercel AI Provider for running LLMs locally using SambaNova's models.
Table of Contents
- Requirements
- Installation
- Setup Environment
- Provider Instance
- Models
- Examples
- Intercepting Fetch requests
Requirements
API key can be obtained from the SambaNova Cloud Platform.
Installation
The SambaNova provider is available in the sambanova-ai-provider module. You can install it with
npm:
npm install sambanova-ai-provideryarn:
yarn add sambanova-ai-provideror pnpm:
pnpm add sambanova-ai-providerSetup Environment
You will need to setup a SAMBANOVA_API_KEY environment variable. You can get your API key on the SambaNova Cloud Portal.
Provider Instance
You can import the default provider instance sambanova from sambanova-ai-provider:
import { sambanova } from 'sambanova-ai-provider';If you need a customized setup, you can import createSambaNova from sambanova-ai-provider and create a provider instance with your settings:
import { createSambaNova } from 'sambanova-ai-provider';
const sambanova = createSambaNova({
apiKey: 'YOUR_API_KEY',
// Optional settings
});You can use the following optional settings to customize the SambaNova provider instance:
baseURL string
Use a different URL prefix for API calls, e.g. to use proxy servers. The default prefix is
https://api.sambanova.ai/v1.apiKey string
API key that is being sent using the
Authorizationheader. It defaults to theSAMBANOVA_API_KEYenvironment variable*.headers Record<string,string>
Custom headers to include in the requests.
fetch (input: RequestInfo, init?: RequestInit) => Promise<Response>
Custom fetch implementation. Defaults to the global
fetchfunction. You can use it as a middleware to intercept requests, or to provide a custom fetch implementation for e.g. testing.
* If you set the environment variable in a .env file, you will need to use a loader like dotenv in order for the script to read it.
Models
You can use SambaNova models on the provider instance.
The first argument is the model ID, e.g. Meta-Llama-3.3-70B-Instruct.
const model = sambanova('Meta-Llama-3.3-70B-Instruct');Tested models and capabilities
This provider is capable of generating and streaming text, interpreting image inputs, run tool callings, and use embeddings.
At least it has been tested with the following features:
| Chat completion | Image input | Tool calling | Embeddings |
|---|---|---|---|
| ✅ | ✅ | ✅ | ✅ |
Image input
You need to use any of the following models for visual understanding:
- Llama-4-Maverick-17B-128E-Instruct
- Llama-4-Scout-17B-16E-Instruct
SambaNova vision models support up to five (5) images per request. They don't support URLs.
Tool calling
You can use any of the Function calling supported models for tool calling.
Embeddings
You can use the E5-Mistral-7B-Instruct model to use the embeddings feature of the SambaNova provider.
Examples
On the examples folder you will find some Markdown files containing simple code snippets of some of the features of the SambaNova Provider.
Intercepting Fetch requests
This provider supports Intercepting Fetch Requests.