Vercel
Vercel is a platform for deploying and hosting web applications, which developers can use to easily manage their websites and serverless functions.
Setup
The SambaNova provider is available via the sambanova-ai-provider
module. You can install it with:
Environment variables
Create a .env
file with a SAMBANOVA_API_KEY
variable.
Provider Instance
You can import the default provider instance 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:
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
Authorization
header. It defaults to theSAMBANOVA_API_KEY
environment 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
fetch
function. You can use it as a middleware to intercept requests, or to provide a custom fetch implementation for e.g. testing.
Models
You can use any of our supported models on a provider instance. The first argument is the model id, e.g. Meta-Llama-3.3-70B-Instruct
.
Example Usage
Basic demonstration of text generation using the SambaNova provider.
You’ll receive an output similar to the following:
Intercepting Fetch Requests
Intercepting fetch requests is supported. You can find more details here.