Skip to main content
LiteLLM is a third-party proxy service. SambaNova doesn’t endorse, maintain, or audit LiteLLM’s security or functionality. This guide is provided for informational purposes and may become outdated. Use at your own discretion.
LiteLLM provides a gateway layer that sits in front of SambaStack’s OpenAI-compatible inference APIs, adding enterprise-grade controls.
Target audience: Engineers integrating a control layer (rate limits, key management, routing) on top of SambaStack’s OpenAI-compatible inference APIs.

Architecture

SambaStack runs your model deployments on dedicated RDU nodes and exposes them behind an OpenAI-compatible HTTPS API. LiteLLM sits in front of those endpoints as a proxy gateway.
LiteLLM architecture diagram showing LiteLLM proxy between client applications and SambaStack inference API

Prerequisites

Before starting, ensure you have:
  • Python 3.11 or above with pip
  • PostgreSQL database (local, self-hosted, or managed)
  • SambaStack API key and base URL
You’ll also need to configure these environment variables:

Getting started

For additional installation options, refer to the official LiteLLM documentation.

Step 1: Set up virtual environment

Step 2: Configure environment variables

Step 3: Set up database

Connect to PostgreSQL as a superuser:
Create the database and user:

Step 4: Initialize database schema

Step 5: Create configuration file

Create litellm_config.yaml:
Replace <MODEL_NAME_1> and <MODEL_NAME_2> with your actual model names from SambaStack.

Step 6: Run LiteLLM proxy

Step 7: Verify installation

1

Login to LiteLLM UI

Navigate to http://localhost:4000/. Use admin as the username and your master key as the password.
2

Verify model connection

Go to Model Management → Health Status. Your model should appear as connected to SambaStack.
3

Run health check

Click Health Check to confirm connectivity.LiteLLM Health Check

Teams, keys, and rate limits

For the full feature set, refer to the official LiteLLM documentation.

Create a team

1

Navigate to Teams

Go to Teams → Create New Team
2

Configure team settings

  • Team name: e.g., Test-team
  • Models: Select your SambaStack model
  • Max Budget (USD): e.g., 10
  • Reset Budget: e.g., monthly
  • RPM limit: e.g., 3 LiteLLM Team Creation
3

Save

Click Save to create the team.

Invite a user

1

Navigate to Internal Users

Go to Internal Users → Invite User
2

Configure user

Enter email, choose a role, and assign to your team.LiteLLM Invite User
3

Send invitation

Copy the invitation link and share it with the user.

Create virtual API keys

1

Navigate to Virtual Keys

Go to Virtual Keys → Create New Key
2

Configure key

  • Team: Select your team
  • Key Name: e.g., limited-key
  • Models: Choose All Team Models or specific model LiteLLM Key Creation
3

Create and copy key

Click Create Key and copy immediately. This is shown only once.

Test the virtual API key

Monitor usage and logs

  • Usage: View spend, requests, and tokens by time range and team at Usage tab
  • Logs: Review request outcomes including rate-limit failures at Logs tab
By default, request/response bodies aren’t stored. Enable storage in the proxy configuration if required for compliance.

In-cluster installation

For production, install LiteLLM in the same Kubernetes cluster as SambaStack for optimal performance. See the LiteLLM Kubernetes deployment guide.

Troubleshooting

Health check fails

Symptom: Model health check returns connection error. Solutions:
  • Verify SAMBASTACK_BASE_URL is correct and accessible
  • Confirm SAMBASTACK_API_KEY is valid
  • Check network connectivity between LiteLLM and SambaStack

Database connection errors

Symptom: LiteLLM fails to start with database errors. Solutions:
  • Verify DATABASE_URL format is correct
  • Confirm PostgreSQL is running and accessible
  • Check that database and user exist with correct permissions

Prisma schema not found

Symptom: prisma generate fails with “schema not found” error. Solution: Ensure virtual environment is activated and litellm[proxy] is installed. Use the dynamic path detection shown in Step 4.

Additional resources