Use this file to discover all available pages before exploring further.
This guide provides a quick overview for getting started with ChatBasetenchat models.Baseten provides inference designed for production applications. Built on the Baseten Inference Stack, these APIs deliver enterprise-grade performance and reliability for leading open-source or custom models: https://www.baseten.co/library/.
Model APIs only support text input, while some dedicated deployments support image and audio input depending on model. Check the Baseten model library for details: https://www.baseten.co/library/
To access Baseten models, you’ll need to create a Baseten account, get an API key, and install the langchain-baseten integration package.Head to the Baseten website to create an account and generate an API key. Once you’ve done this, set the BASETEN_API_KEY environment variable:
Model APIs: For access to the latest, most popular opensource models.
Dedicated URLs: Use specific model deployments with dedicated resources.
Both approaches are supported with automatic endpoint normalization.
Initialize with model slug
from langchain_baseten import ChatBaseten# Option 1: Use Model APIs with model slugmodel = ChatBaseten( model="moonshotai/Kimi-K2-Instruct-0905", # Choose from available model slugs: https://docs.baseten.co/development/model-apis/overview#supported-models api_key="your-api-key", # Or set BASETEN_API_KEY env var)
Initialize with model URL
from langchain_baseten import ChatBaseten# Option 2: Use dedicated deployments with model urlmodel = ChatBaseten( model_url="https://model-<id>.api.baseten.co/environments/production/predict", api_key="your-api-key", # Or set BASETEN_API_KEY env var)