LLM providers
shipit_agent runs the SAME agent code on OpenAI, Anthropic, AWS Bedrock, Google Vertex, Gemini, Groq, Together, Ollama, and any LiteLLM-reachable model. Pick a provider two ways — a direct adapter class, or build_llm_from_env() driven by SHIPIT_LLM_PROVIDER — and swap providers in one line.
shipit_agent is provider-agnostic. The Agent, DeepAgent, tools,
streaming, RAG, caching, and tracing layers never care which model is behind
the LLM — they only talk to the small LLM interface. That means you write
your agent once and run it on whichever provider you want.
There are two ways to get an LLM:
- Direct adapter class — import the adapter and construct it. Explicit, great for code that pins one provider.
build_llm_from_env()— setSHIPIT_LLM_PROVIDER(plus that provider's credentials) in your.envand let the factory pick the adapter. Great for "swap providers without touching code."
Both come from shipit_agent.llms:
from shipit_agent.llms import (
build_llm_from_env,
OpenAIChatLLM,
AnthropicChatLLM,
BedrockChatLLM,
VertexAIChatLLM,
GeminiChatLLM,
GroqChatLLM,
TogetherChatLLM,
OllamaChatLLM,
LiteLLMChatLLM,
LiteLLMProxyChatLLM,
)Swap providers in one line
The rest of your agent code is identical regardless of provider. Only the one line that builds the LLM changes:
from shipit_agent import Agent
from shipit_agent.llms import build_llm_from_env
llm = build_llm_from_env("openai") # ← change "openai" to any provider below
# everything from here down never changes:
agent = Agent.with_builtins(llm=llm)
print(agent.run("Find today's Bitcoin price in USD.").output)Or change nothing in code at all — set SHIPIT_LLM_PROVIDER in .env and call
build_llm_from_env() with no argument:
# .env
SHIPIT_LLM_PROVIDER=anthropic # bedrock|openai|anthropic|gemini|vertex|groq|together|ollama|litellmllm = build_llm_from_env() # reads SHIPIT_LLM_PROVIDER from .envDefault provider
If SHIPIT_LLM_PROVIDER is unset, the factory defaults to bedrock.
Pass an explicit provider (build_llm_from_env("openai")) to override
.env for a single call.
Every supported provider
| Provider | SHIPIT_LLM_PROVIDER | Adapter class | Required env vars | Default model |
|---|---|---|---|---|
| OpenAI | openai | OpenAIChatLLM | OPENAI_API_KEY | gpt-4o-mini |
| Anthropic | anthropic | AnthropicChatLLM | ANTHROPIC_API_KEY | claude-3-5-sonnet-latest |
| AWS Bedrock | bedrock | BedrockChatLLM | AWS_REGION_NAME (or AWS_DEFAULT_REGION) or AWS_PROFILE | bedrock/openai.gpt-oss-120b-1:0 |
| Google Vertex | vertex | VertexAIChatLLM | creds file + VERTEXAI_PROJECT + VERTEXAI_LOCATION | vertex_ai/gemini-1.5-pro |
| Google Gemini | gemini | GeminiChatLLM | GEMINI_API_KEY or GOOGLE_API_KEY | gemini/gemini-1.5-pro |
| Groq | groq | GroqChatLLM | GROQ_API_KEY | groq/llama-3.3-70b-versatile |
| Together | together | TogetherChatLLM | TOGETHERAI_API_KEY or TOGETHER_API_KEY | together_ai/meta-llama/Llama-3.1-70B-Instruct-Turbo |
| Ollama (local) | ollama | OllamaChatLLM | none — needs a local Ollama server | ollama/llama3.1 |
| LiteLLM (proxy to ~everything) | litellm | LiteLLMChatLLM / LiteLLMProxyChatLLM | SHIPIT_LITELLM_MODEL (+ provider creds / SHIPIT_LITELLM_API_BASE) | none — SHIPIT_LITELLM_MODEL required |
Per-provider init snippets follow. Each shows both the direct adapter class
and the matching build_llm_from_env() env-var setup.
OpenAI
from shipit_agent.llms import OpenAIChatLLM, build_llm_from_env
# Direct:
llm = OpenAIChatLLM(model="gpt-4o-mini")
# Force at least one tool call per turn (lazy models):
llm = OpenAIChatLLM(model="gpt-4o-mini", tool_choice="required")
# From env:
llm = build_llm_from_env("openai")SHIPIT_LLM_PROVIDER=openai
OPENAI_API_KEY=sk-...
SHIPIT_OPENAI_MODEL=gpt-4o-mini # optional
SHIPIT_OPENAI_TOOL_CHOICE= # optional — "required" forces a tool callOpenAI does automatic prompt caching; shipit surfaces the cache reads. See Prompt caching.
Anthropic
from shipit_agent.llms import AnthropicChatLLM, build_llm_from_env
# Direct (prompt caching on by default for Claude):
llm = AnthropicChatLLM(model="claude-sonnet-4-20250514")
# Extended thinking:
llm = AnthropicChatLLM(model="claude-opus-4-1", thinking_budget_tokens=2048)
# From env:
llm = build_llm_from_env("anthropic")SHIPIT_LLM_PROVIDER=anthropic
ANTHROPIC_API_KEY=sk-ant-...
SHIPIT_ANTHROPIC_MODEL=claude-3-5-sonnet-latest # optionalAWS Bedrock
Bedrock authenticates with AWS credentials, not an API key — a region plus
your standard AWS access keys, an AWS_PROFILE, or an instance role.
from shipit_agent.llms import BedrockChatLLM, build_llm_from_env
# Direct:
llm = BedrockChatLLM(model="bedrock/openai.gpt-oss-120b-1:0")
# Claude on Bedrock (tool-pairing handled automatically):
llm = BedrockChatLLM(model="bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0")
# From env:
llm = build_llm_from_env("bedrock")SHIPIT_LLM_PROVIDER=bedrock
AWS_REGION_NAME=us-east-1 # or AWS_DEFAULT_REGION, or set AWS_PROFILE
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_SESSION_TOKEN= # optional
SHIPIT_BEDROCK_MODEL=bedrock/openai.gpt-oss-120b-1:0 # optionalGoogle Vertex AI
Vertex needs a service-account JSON file plus a project and a location.
from shipit_agent.llms import VertexAIChatLLM, build_llm_from_env
# Direct:
llm = VertexAIChatLLM(
model="vertex_ai/gemini-1.5-pro",
service_account_file="/path/to/sa.json",
project_id="my-gcp-project",
location="us-central1",
)
# From env:
llm = build_llm_from_env("vertex")SHIPIT_LLM_PROVIDER=vertex
GOOGLE_APPLICATION_CREDENTIALS=/path/to/sa.json # or SHIPIT_VERTEX_CREDENTIALS_FILE
VERTEXAI_PROJECT=my-gcp-project # or GOOGLE_CLOUD_PROJECT
VERTEXAI_LOCATION=us-central1 # or VERTEX_LOCATION / GOOGLE_CLOUD_LOCATION
SHIPIT_VERTEX_MODEL=vertex_ai/gemini-1.5-pro # optionalThe Vertex adapter handles the full Vertex catalog — Gemini, Claude-on-Vertex,
Llama-on-Vertex, etc. Claude-on-Vertex gets cache_control prompt caching too.
Google Gemini
from shipit_agent.llms import GeminiChatLLM, build_llm_from_env
# Direct:
llm = GeminiChatLLM(model="gemini/gemini-1.5-pro")
# From env:
llm = build_llm_from_env("gemini")SHIPIT_LLM_PROVIDER=gemini
GEMINI_API_KEY=... # or GOOGLE_API_KEY
SHIPIT_GEMINI_MODEL=gemini/gemini-1.5-pro # optionalGroq
from shipit_agent.llms import GroqChatLLM, build_llm_from_env
# Direct:
llm = GroqChatLLM(model="groq/llama-3.3-70b-versatile")
# From env:
llm = build_llm_from_env("groq")SHIPIT_LLM_PROVIDER=groq
GROQ_API_KEY=gsk_...
SHIPIT_GROQ_MODEL=groq/llama-3.3-70b-versatile # optionalTogether AI
from shipit_agent.llms import TogetherChatLLM, build_llm_from_env
# Direct:
llm = TogetherChatLLM(
model="together_ai/meta-llama/Llama-3.1-70B-Instruct-Turbo"
)
# From env:
llm = build_llm_from_env("together")SHIPIT_LLM_PROVIDER=together
TOGETHERAI_API_KEY=... # or TOGETHER_API_KEY
SHIPIT_TOGETHER_MODEL=together_ai/meta-llama/Llama-3.1-70B-Instruct-Turbo # optionalOllama (local models)
No API key — just a running local Ollama server.
from shipit_agent.llms import OllamaChatLLM, build_llm_from_env
# Direct:
llm = OllamaChatLLM(model="ollama/llama3.1")
# From env:
llm = build_llm_from_env("ollama")SHIPIT_LLM_PROVIDER=ollama
SHIPIT_OLLAMA_MODEL=ollama/llama3.1 # optionalLiteLLM (proxy to ~everything)
LiteLLM routes to ~100 providers behind one interface. Use the direct
LiteLLMChatLLM for any LiteLLM-format model string, or LiteLLMProxyChatLLM
to point at a self-hosted LiteLLM proxy gateway. With build_llm_from_env, the
factory picks LiteLLMProxyChatLLM automatically when SHIPIT_LITELLM_API_BASE
is set, otherwise LiteLLMChatLLM.
from shipit_agent.llms import (
LiteLLMChatLLM,
LiteLLMProxyChatLLM,
build_llm_from_env,
)
# Direct — any LiteLLM model string:
llm = LiteLLMChatLLM(model="anthropic/claude-sonnet-4-20250514")
# Direct — self-hosted LiteLLM proxy gateway:
llm = LiteLLMProxyChatLLM(
model="gpt-4o-mini", # whatever the proxy routes to
api_base="https://litellm.my-company.internal",
api_key="sk-proxy-token",
custom_llm_provider="openai", # proxy speaks OpenAI format
)
# From env (LiteLLMChatLLM, or LiteLLMProxyChatLLM if SHIPIT_LITELLM_API_BASE set):
llm = build_llm_from_env("litellm")SHIPIT_LLM_PROVIDER=litellm
SHIPIT_LITELLM_MODEL=anthropic/claude-sonnet-4-20250514 # required
SHIPIT_LITELLM_API_KEY= # optional
SHIPIT_LITELLM_API_BASE= # set → LiteLLMProxyChatLLM
SHIPIT_LITELLM_CUSTOM_PROVIDER= # optionalLiteLLM forwards both cache-token shapes (Anthropic cache_read_input_tokens
and OpenAI prompt_tokens_details.cached_tokens), so cross-provider cost
accounting keeps working through the proxy.
See also
- Environment setup —
.envdiscovery, credential requirements, and switching providers without restarting. - Quick start — get an agent running in five minutes on any provider.
- Prompt caching — caching works across
Anthropic, Bedrock, Vertex (
cache_control), and OpenAI (automatic); LiteLLM forwards both.