Files
567-labs--instructor/docs/integrations/sambanova.md
T
wehub-resource-sync 97e91a83f3
Ruff / Ruff (push) Has been cancelled
Test / Core Tests (push) Has been cancelled
Test / Offline Coverage Tests (Python 3.10) (push) Has been cancelled
Test / Offline Coverage Tests (Python 3.11) (push) Has been cancelled
Test / Offline Coverage Tests (Python 3.12) (push) Has been cancelled
Test / Offline Coverage Tests (Python 3.13) (push) Has been cancelled
Test / Offline Coverage Tests (Python 3.9) (push) Has been cancelled
Test / Full Coverage (Python 3.11) (push) Has been cancelled
Test / Core Provider Tests (OpenAI) (push) Has been cancelled
Test / Core Provider Tests (Anthropic) (push) Has been cancelled
Test / Core Provider Tests (Google) (push) Has been cancelled
Test / Core Provider Tests (Other) (push) Has been cancelled
Test / Anthropic Tests (push) Has been cancelled
Test / Gemini Tests (push) Has been cancelled
Test / Google GenAI Tests (push) Has been cancelled
Test / Vertex AI Tests (push) Has been cancelled
Test / OpenAI Tests (push) Has been cancelled
Test / Writer Tests (push) Has been cancelled
Test / Auto Client Tests (push) Has been cancelled
ty / type-check (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:36:38 +08:00

1.7 KiB

title, description
title description
SambaNova Use Instructor with SambaNova's LLM API for structured outputs.

See Also

SambaNova Integration

Instructor supports SambaNova's LLM API, allowing you to use structured outputs with their models.

Installation

pip install "instructor[openai]"

Basic Usage

import instructor
from pydantic import BaseModel

client = instructor.from_provider("sambanova/Meta-Llama-3.1-405B-Instruct")

class User(BaseModel):
    name: str
    age: int

user = client.create(
    messages=[
        {"role": "user", "content": "Ivan is 28"},
    ],
    response_model=User,
)

print(user)
# > User(name='Ivan', age=28)

Async Usage

import instructor
from pydantic import BaseModel

client = instructor.from_provider(
    "sambanova/Meta-Llama-3.1-405B-Instruct",
    async_client=True,
)

class User(BaseModel):
    name: str
    age: int

async def get_user():
    user = await client.create(
        messages=[
            {"role": "user", "content": "Ivan is 28"},
        ],
        response_model=User,
    )
    return user

# Run with asyncio
import asyncio
user = asyncio.run(get_user())
print(user)
# > User(name='Ivan', age=28)

Available Models

Check the SambaNova documentation for the latest model offerings and capabilities.