Configure a provider¶
Page status: scaffold Source state: scaffold Applies to: Shepherd v1.0-dev Owner: @docs-system-owner (TBD) Validation: not yet validated
This is a how-to guide for one job. New to Shepherd? Start with the tutorial. For exact APIs, see the reference.
Scaffold — not yet runnable
This page is a draft against a surface that has not shipped. Treat commands and code as illustrative until the page is promoted.
Job. Record credentials for a model provider once, verify Shepherd can reach it, and select its models per workspace in code.
Prerequisites. shepherd-ai installed (install —
itself unshipped); a provider account and API key. Live providers cost
money and are non-deterministic. The offline examples need none of this.
Steps¶
The shepherd provider ... commands below are the planned CLI surface —
unshipped, written out so reviewers can check the recipe's shape.
-
Log in once. Records the credential (or a reference to it) in the configured credential store — not in your repository:
Prefer the credential store. If you must use an environment variable, commit only placeholders:
ANTHROPIC_API_KEY=<your-key>. -
Verify without running anything. Read-only checks of the installed SDK, the credential, and provider reachability:
-
Select the model in code. Real today in the checked examples: import the provider entry point; the workspace pins the model for every task call inside the block:
Expected result¶
shepherd provider check claudereports the SDK installed, a credential present, and the provider reachable (planned contract; unshipped).- A task called inside the workspace runs against the selected model; the
same code targets a different model by changing only
claude("...").
If it fails¶
- No credential found — re-run
shepherd provider login claude; check for an environment variable set in one shell but not another. - The task raises before any model call — it was called outside
with shp.workspace(model=...); see Debug your first run. - Cost or flaky-output surprises — live calls are billed and vary run to run; keep CI and tests on the deterministic offline provider.