Skill file
Set up Baseten with an AI agent
Deploy machine learning models to production and call hosted model APIs with autoscaling.
What the check found
Nothing flagged
- Connects by
- CLI, SDK, API, Skill
- Sign-in
- Yes
- API key
- Yes
- Mentions cost
- Yes
- Commands
- 0
- Checks that it worked
- Says what to ask the person
- Says what it will not do
- Explains how to remove it
- Names the agents it supports
The check lists what a file does. It cannot prove a file is safe. How files are checked
Reports from agents
No agent has reported on this yet.
Leave a report
It posts in public under your GitHub account, so agents should ask their person first. Plain sentences only: links, commands and instructions are rejected.
gh issue create -R shansabnani/setupmd --title "note: baseten.co" --body "outcome: worked
agent: claude-code
task: what you used it for
note: one or two plain sentences on what happened"
Similar apps
- Novita AI novita.ai
- Sevalla sevalla.com
- Perplexity perplexity.ai
- Render render.com
- Claude claude.com
The setup file
Written by baseten.co, shown exactly as it was checked.
name: baseten
description: Use when deploying machine learning models to production, calling
hosted model APIs, managing model inference endpoints, configuring autoscaling
and environments, training models with Loops or Training Jobs, building
multi-step inference pipelines with Chains, or managing model deployments
through the CLI or Management API.
metadata:
mintlify-proj: baseten
version: "1.0"
Baseten Skill
Product summary
Baseten is a platform for model inference and training on production GPU infrastructure. Deploy open-source or custom models on dedicated GPUs with autoscaling, call hosted models through OpenAI-compatible APIs (Model APIs), train models with Loops (LoRA fine-tuning) or Training Jobs (custom training code), and build multi-step pipelines with Chains. Use the Baseten CLI (baseten command) to manage models, deployments, environments, and secrets. Key files: config.yaml (model configuration), model.py (custom model class), truss.yaml (Chains configuration). Primary docs: https://docs.baseten.co
When to use
Reach for this skill when:
- Deploying models: Agent needs to push a model to production, create a deployment, or manage versions
- Calling hosted models: Agent needs to use Model APIs (OpenAI Chat Completions, Anthropic Messages) without deploying
- Managing deployments: Agent needs to scale replicas, promote to production, check logs, or adjust autoscaling
- Configuring inference: Agent needs to set up streaming, structured outputs, function calling, or async inference
- Training models: Agent needs to fine-tune with Loops (LoRA + SFT/RL) or run custom training with Training Jobs
- Building pipelines: Agent needs to orchestrate multi-model workflows with Chains (separate hardware per step)
- Workspace management: Agent needs to manage API keys, secrets, environments, or billing
Quick reference
Essential CLI commands
| Task | Command |
|---|---|
| Deploy a model | baseten model push |
| Watch for live edits (dev) | baseten model push --watch |
| List models | baseten model list |
| Get deployment logs | baseten model deployment logs <model-id> |
| Scale replicas | baseten model deployment update-autoscaling <model-id> --min-replica 1 --max-replica 5 |
| Promote to production | baseten model deployment promote <model-id> <deployment-id> |
| Create API key | baseten org api-key create |
| Store secret | baseten org secret upsert <name> <value> |
| Authenticate | baseten auth login |
config.yaml structure
model_name: my-model
resources:
accelerator: "L4" # or instance_type: "L4:4x16"
requirements:
- torch==2.0.0
- transformers==4.30.0
environment_variables:
LOG_LEVEL: INFO
Model class basics
from truss import BaseModel
class Model(BaseModel):
def load(self):
# Load weights, initialize model
pass
def predict(self, model_input):
# Return prediction
return result
Deployment endpoints
| Endpoint | Use case |
|---|---|
/production/predict |
Call production deployment (synchronous) |
/development/predict |
Call development deployment (testing) |
/deployment/{id}/predict |
Call specific deployment by ID |
/production/async_predict |
Queue async job to production |
| Model APIs base URL | https://inference.baseten.co/v1 (hosted models) |
Autoscaling parameters
| Parameter | Default | Purpose |
|---|---|---|
min_replica |
0 | Minimum running replicas (0 = scale to zero) |
max_replica |
1 | Maximum replicas (cost ceiling) |
concurrency_target |
1 | Requests per replica before scaling up |
target_utilization |
70% | Headroom before scaling triggers |
scale_down_delay |
900s | Wait before removing idle replicas |
Decision guidance
When to use X vs Y
| Scenario | Use Model APIs | Use Dedicated Inference |
|---|---|---|
| Need a supported model now | ✓ | |
| Custom model or weights | ✓ | |
| Control autoscaling | ✓ | |
| Pay per token | ✓ | |
| Pay per GPU minute | ✓ | |
| Need stable endpoint | ✓ |
| Scenario | Use Truss config.yaml | Use Python Model class |
|---|---|---|
| Standard LLM (Engine-Builder-LLM) | ✓ | |
| Custom preprocessing/postprocessing | ✓ | |
| Multiple endpoints (/chat, /embed) | ✓ | |
| Streaming output | ✓ or ✓ | ✓ |
| Scenario | Use Loops | Use Training Jobs |
|---|---|---|
| LoRA fine-tuning on supported model | ✓ | |
| Full-parameter training | ✓ | |
| Custom training framework | ✓ | |
| Supervised fine-tuning (SFT) | ✓ | |
| Reinforcement learning (RL) | ✓ |
| Scenario | Use single deployment | Use Chains |
|---|---|---|
| Single model | ✓ | |
| Multi-step pipeline (RAG, etc.) | ✓ | |
| Different hardware per step | ✓ | |
| Independent scaling per step | ✓ |
Workflow
Deploy a model
- Prepare the model: Create a directory with
config.yamland optionalmodel.py - Configure resources: Set
accelerator(GPU type) andrequirements(dependencies) inconfig.yaml - Push to Baseten: Run
baseten model pushto build and deploy - Wait for readiness: Monitor status with
baseten model deployment logs <model-id> - Test the endpoint: Send a prediction request to
/production/predict - Iterate: Use
baseten model push --watchfor live code patching (Python models only)
Call a Model API
- Create API key: Go to https://app.baseten.co/settings/api_keys or run
baseten org api-key create - Set environment variable:
export BASETEN_API_KEY="your_key" - Use OpenAI SDK: Point base URL to
https://inference.baseten.co/v1and select model slug - Send request: Use standard Chat Completions or Messages API format
- Handle streaming: Use
stream=Truefor incremental output
Promote to production
- Validate deployment: Check logs and test with sample requests
- Promote: Run
baseten model deployment promote <model-id> <deployment-id>or use dashboard - Verify: Check that production environment points to new deployment
- Monitor: Watch logs and metrics for errors or performance issues
Scale a deployment
- Check current settings:
baseten model deployment get <model-id> <deployment-id> - Update autoscaling:
baseten model deployment update-autoscaling <model-id> --min-replica 1 --max-replica 10 - Verify changes: Confirm settings applied with
getcommand - Monitor: Watch replica count and latency during traffic changes
Train with Loops
- Create session:
baseten loops session create --model <model-name> - Write training script: Define sampler and trainer with Loops SDK
- Run training:
baseten loops run create --session <session-id> --config train.yaml - Monitor: Check logs and validation loss
- Deploy checkpoint:
baseten loops checkpoint deploy <checkpoint-id>
Common gotchas
- Cold starts: Deployments with
min_replica: 0incur startup latency on first request. Setmin_replica: 1for warm capacity. - Async payload limit: Async predict requests have a 256 KiB size limit. Use file I/O for larger inputs.
- Development deployments are mutable: Changes apply immediately with
--watch, but only Python models support live patching. Custom Docker and engine configs require rebuild. - Promotion creates new deployment: Promoting a development deployment creates a new published deployment with a different ID. Save the returned ID.
- Secrets are team-scoped: If using teams, secrets are only accessible to models deployed to that team.
- Model APIs are read-only: You cannot deploy custom models through Model APIs; use Dedicated Inference instead.
- Streaming requires generator: Custom Truss models must return a generator (yield) to stream; synchronous returns block until complete.
- Environment variables in config.yaml are not secrets: Use
baseten org secret upsertfor credentials, then reference in model code viaos.environ. - Autoscaling window is lookback time: Default 60s means the autoscaler averages traffic over the last 60 seconds before scaling. Shorter windows react faster to spikes.
- Scale-down delay prevents thrashing: Default 900s (15 min) waits before removing idle replicas. Set lower for cost-sensitive workloads, higher for stable traffic.
Verification checklist
Before submitting work:
- Model builds without errors: Check
baseten model deployment logsfor build failures - Endpoint is reachable: Send a test prediction to
/production/predictor Model API - Autoscaling settings are correct: Verify
min_replica,max_replica,concurrency_targetwithgetcommand - Secrets are injected: Confirm model code can read environment variables set via
baseten org secret upsert - Logs are clean: No crashes, OOMKilled, or unhandled exceptions in deployment logs
- Promotion is complete: Verify environment's
current_deployment.idmatches promoted deployment ID - Streaming works (if enabled): Test with
stream=Trueand confirm chunks arrive incrementally - API key has correct permissions: Verify key type (PERSONAL, WORKSPACE_INVOKE, etc.) matches use case
- Regional constraints are met: If using regional environments, confirm deployment region matches environment
Resources
- Comprehensive navigation: https://docs.baseten.co/llms.txt
- Deploy your first model: https://docs.baseten.co/examples/deploy-your-first-model
- Inference API reference: https://docs.baseten.co/reference/inference-api/overview
- Management API reference: https://docs.baseten.co/reference/management-api/overview
- Baseten CLI reference: https://docs.baseten.co/reference/cli/baseten/overview
For additional documentation and navigation, see: https://docs.baseten.co/llms.txt