Loading…
Loading…
Features · Build · Any model
An agent needs a model adapter, its llm. Build one in code or let shipit build it from environment variables; tools, permissions and streaming behave the same on every provider.
from shipit_agent import Agentfrom shipit_agent.llms import build_llm_from_env# reads SHIPIT_ANTHROPIC_MODEL and ANTHROPIC_API_KEYllm = build_llm_from_env("anthropic")agent = Agent.with_builtins(llm=llm, project_root=".")print(agent.run("What does this repo do?").output)
Your code
build_llm_from_env()
Provider profile
18 built in
Model
GPT, Gemini, Gemma, Llama, Haiku…
Same agent loop
tools, streaming, permissions
The code is a checked example from the docs; the output is an example of what it prints.
from shipit_agent import Agent
from shipit_agent.llms import build_llm_from_env
# reads SHIPIT_ANTHROPIC_MODEL and ANTHROPIC_API_KEY
llm = build_llm_from_env("anthropic")
agent = Agent.with_builtins(llm=llm, project_root=".")
print(agent.run("What does this repo do?").output)6 more ways to use it
Each example is from the docs and checked against the library.
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)All 19 model providers
Each built-in provider profile, with its default model, the variable that picks another, and the key it reads.
anthropicazurebedrockcerebrascoheredeepseekfireworksgeminigroqlitellmmistralollamaopenaiopenrouterperplexityshipittogethervertexxaiFrom a model name
Pass a model id to the Agent SDK API, or an adapter to Agent.
From the environment
SHIPIT_LLM_PROVIDER picks the provider; each has its own model variable and keys.
Fallbacks and retries
A fallback model, a retry policy and a router policy are Agent parameters.
Keys stay out of code
build_llm_from_env() also reads the first .env file it finds.
| Parameter | Default | What it does |
|---|---|---|
| llm | required | The model adapter. |
| fallback_model | None | Used when the model fails after its retries: a model id, ids separated by commas, an adapter, or a list of them (see `llms/fallback.py`). |
| retry_policy | empty | Retries for transient model and tool errors. RetryPolicy. |
| router_policy | empty | When to plan before the first turn. RouterPolicy. |
| context_window_tokens | 0 | 0 = automatic model limit; positive = explicit limit; -1 = disabled. |