Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,12 @@ jobs:
# The publish job uploads this same launch-stack.yaml to S3.
node selfhost/launch/stamp-template.mjs infra/cfn/coderhelm-selfhost-launch.yaml "$TAG" > dist/launch-stack.yaml
cp selfhost/launch/bootstrap.mjs dist/launch-bootstrap.mjs
(cd dist && sha256sum gateway.zip worker.zip mcp-proxy.zip dashboard.tar.gz source.tar.gz coderhelm-selfhost.tgz install.sh launch-stack.yaml launch-bootstrap.mjs > SHA256SUMS)
# The models this release calls, read from the code, with their
# Bedrock ids per inference profile prefix. In the signed
# SHA256SUMS: the updater reads it only through the update build,
# after the signature check (lambda/updater, model_check).
node selfhost/launch/release-models.mjs "$TAG" > dist/models.json
(cd dist && sha256sum gateway.zip worker.zip mcp-proxy.zip dashboard.tar.gz source.tar.gz coderhelm-selfhost.tgz install.sh launch-stack.yaml launch-bootstrap.mjs models.json > SHA256SUMS)
cat dist/SHA256SUMS

# The release's own CDK app synthesizes for a fresh self-host config.
Expand Down Expand Up @@ -258,6 +263,7 @@ jobs:
dist/install.sh
dist/launch-bootstrap.mjs
dist/launch-stack.yaml
dist/models.json

# A published release's files are never replaced: a re-run only fills in
# a release that has no SHA256SUMS yet (one made by hand, without
Expand Down
51 changes: 45 additions & 6 deletions docs/self-host/model-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Call Claude through the Anthropic API with each team's key, or thro
order: 5
---

CoderHelm uses Claude for every run, review, plan chat and log analysis. You pick how it is reached with `models.provider` in the config.
CoderHelm uses Claude for every run, review, plan chat and log analysis. You pick how it is reached when you install (`models.provider` in the config, or the install guide's **Models** step), and you can change it later in **Settings, System, Models** without a redeploy. See [Switch providers](#switch-providers).

## Anthropic API (default)

Expand All @@ -25,10 +25,7 @@ Each team adds its own Anthropic API key in **Settings, AI models**, and picks i

The gateway, streaming, worker and log analyzer functions call Bedrock with their own IAM roles. No API key exists anywhere; usage and cost land on your AWS bill, and data stays in AWS.

**Before you deploy:**

1. In the Bedrock console of your region, open **Model access** and enable the Claude models you will use (by default Claude Opus 5.5 and Claude Sonnet 5.5). Some models ask you to accept terms first.
2. Pick the inference profile prefix for your region: `us.` for US regions, `eu.` for Europe, `apac.` for Asia Pacific, `global.` for the global profiles, or `""` to call a model in your region directly.
**Before you deploy (or switch):** see [Bedrock model access](#bedrock-model-access) below, then pick the inference profile prefix for your region: `us.` for US regions, `eu.` for Europe, `apac.` for Asia Pacific, `global.` for the global profiles, or `""` to call a model in your region directly.

**How model names map to Bedrock ids.** Teams and the config use Anthropic's model names (`claude-opus-5-5`). CoderHelm turns them into Bedrock ids:

Expand All @@ -41,10 +38,51 @@ The gateway, streaming, worker and log analyzer functions call Bedrock with thei
- a name that already is a Bedrock id (contains `anthropic.`) is used as it is;
- otherwise it becomes `<prefix>anthropic.<name>`, so `claude-sonnet-5-5` with `us.` is `us.anthropic.claude-sonnet-5-5`. Models whose Bedrock id carries a date (Claude Haiku 4.5) are mapped to the dated id for you.

**What the roles may call:** `bedrock:InvokeModel` and `bedrock:InvokeModelWithResponseStream` on Anthropic foundation models and your account's inference profiles, nothing else.
**What the roles may call:** `bedrock:InvokeModel` (which also covers the Converse API) and `bedrock:InvokeModelWithResponseStream` on Anthropic foundation models and your account's inference profiles, nothing else. Every self-hosted install gets this, even one that starts on Anthropic keys, so you can switch to Bedrock later without a redeploy. The roles never get `aws-marketplace:Subscribe` or the calls that accept a model agreement or submit the use case form.

With Bedrock, the **Settings, AI models** page says the install uses Bedrock and no key is needed; teams can still choose which models they use.

## Bedrock model access

Before CoderHelm can call a Claude model on Bedrock, someone in your company does three things in the AWS console, once per account. CoderHelm never does them for you: it only links to the page and checks the result.

1. **Model access.** In the Bedrock console of your region, open **Model access** and turn on the Claude models CoderHelm calls (by default Claude Opus 5.5 and Claude Sonnet 5.5).
2. **Use case form.** The first time an account asks for an Anthropic model, Bedrock asks for a short description of how you will use it (**Submit use case details** on the same page). A person fills it in; it applies to every Anthropic model in the account.
3. **Anthropic's terms (AWS Marketplace).** Each Anthropic model is offered through AWS Marketplace. Accepting its terms subscribes your account; this needs a user allowed to subscribe in Marketplace and a valid payment method on the account. It can take a few minutes to finish.

If a step is missing, every check (Setup, a switch, an update) names the model, says which step in one sentence, and links to the page. Then use **Check again**.

## Switch providers

Install admins can switch at any time in **Settings, System, Models**:

- **Claude on Amazon Bedrock**, with the inference profile prefix (default `us.`) and, under **Advanced**, an exact Bedrock id for any model (an application inference profile ARN, for example).
- **Anthropic API keys**. Each team keeps using its own key from **Settings, AI models**, as before. There is no install-wide key: the key already lives with each team, every service reads it there, and each team's usage stays on its own Anthropic account.

Before anything is saved, CoderHelm makes one test call (one token) to every model the running release calls, through the provider you picked: Bedrock with your settings, or the Anthropic API with your team's key. If any model is refused, nothing changes and you see which model, the fix in one sentence and a link, with **Check again**. A switch to Anthropic keys needs your own team to have a working key first.

A saved switch:

- is written to your team's audit log first (who, when, from what to what); if the log can't be written, nothing changes;
- reaches every part of CoderHelm within 30 seconds, with no redeploy;
- never stops a run. Model calls already under way finish where they started, and later calls use the new provider. A run that started on Bedrock without a team key keeps using Bedrock until it ends.

The deploy config's `models` settings are only the first-boot default. Once you switch in Settings, that choice wins until you switch again; a redeploy doesn't undo it.

## Updates and new models

A new release can call a model your install hasn't used before. Each release publishes `models.json` with the models it calls and their Bedrock ids for every prefix. It is made from the code, so it can't miss one. It is listed in the release's signed `SHA256SUMS`, and your install only reads it through a small read-only build (`<prefix>-release-check`) that checks the signature first, exactly like an update does; a file that doesn't match is never used.

Before the updater applies a release, automatically or with **Update now**, it makes one test call to each of those models (plus the ones your config names) through your current provider:

- **All answer:** the update goes ahead as usual.
- **One is refused** (model access off, use case form missing, Marketplace terms not accepted or still processing, IAM, or the model isn't offered in your region): the update doesn't start. **Settings, System** and **Setup** show **Update to vX needs your action** with the model, the fix and the console link. Install admins get one email (and a post to `updates.webhookUrl` if set).
- The check runs again every day. Once it passes, the update applies by itself in your maintenance window if auto-update is on; otherwise **Update now** works again.

**Update now** has no override for a model the release calls. **Skip this check** appears only when the failing model isn't one the release calls.

On the Anthropic API there are no terms to accept; the check uses the key of the team that last switched to keys, and is skipped when there is no such key. Models a team picks in **Settings, AI models** are checked by **Setup**, not before an update.

## Which to choose

| | Anthropic API | Bedrock |
Expand All @@ -54,6 +92,7 @@ With Bedrock, the **Settings, AI models** page says the install uses Bedrock and
| Data path | Your AWS, then Anthropic | Stays in AWS |
| New models | Available on release day | When Bedrock adds them in your region |
| Setup | Nothing at deploy | Enable model access first |
| Change later | Settings, System, Models | Settings, System, Models |

## Embeddings

Expand Down
8 changes: 6 additions & 2 deletions docs/self-host/updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,17 @@ npx -y github:CoderHelm/coderhelm-platform auto-update on --window "Sun 03:00" -

The settings take effect at once (no deploy). The same values in `coderhelm.config.json` under `updates` are the starting point of a new install.

An update starts only when all of these hold: auto-update is on, the hour is the window's hour in your time zone, the release is on your channel, it isn't a major release while majors are `ask`, no update is running, and that version hasn't already failed (an admin can still start it by hand).
An update starts only when all of these hold: auto-update is on, the hour is the window's hour in your time zone, the release is on your channel, it isn't a major release while majors are `ask`, no update is running, that version hasn't already failed (an admin can still start it by hand), and every model the release calls answers a test call through your provider.

## The model check

Each release lists the models it calls (`models.json`, made from the code and covered by the signed `SHA256SUMS`). The updater reads it only after a read-only build has checked the release's signature and the file's checksum; until then the update waits. Before an update, automatic or **Update now**, the updater asks the worker to make one test call to each, through your current provider (Bedrock or Anthropic keys). If one is refused, the update waits: **Settings, System** and **Setup** say **Update to vX needs your action** with the model, the fix and the AWS console link, and admins get one email. The check runs again daily and the update applies by itself once it passes (with auto-update on). **Check again** reruns it now. CoderHelm never accepts model terms or submits forms for you; see [Model providers](./model-providers.md#bedrock-model-access).

## Update readiness

Before you update, **Settings, then System** shows **Update readiness**: the same checks an update makes, run now, each with its fix.

- **Blocks the update:** a check that fails (the update's health check would stop it), or an update already running. **Update now** stays off until it is fixed.
- **Blocks the update:** a check that fails (the update's health check would stop it), a model the release calls that was refused, or an update already running. **Update now** stays off until it is fixed.
- **Read first:** a major release whose notes ask you to do something, or a release whose last try failed or rolled back (with the reason).

Each item says what is wrong and how to fix it: a command to copy, a link, or a page in CoderHelm. **Check again** reruns them. The same list is `GET /api/system/preflight`; see [Check your install](./check-your-install.md).
Expand Down
2 changes: 1 addition & 1 deletion infra/cfn/coderhelm-selfhost-launch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Parameters:
Type: String
Default: bedrock
AllowedValues: [bedrock, anthropic]
Description: bedrock (Claude on Amazon Bedrock in this account, no API key) or anthropic (each team adds its own Anthropic API key).
Description: bedrock (Claude on Amazon Bedrock in this account, no API key) or anthropic (each team adds its own Anthropic API key). You can change this later in Settings, System.
Version:
Type: String
# Stamped with the release's own tag when the release is published
Expand Down
27 changes: 24 additions & 3 deletions infra/lib/service-env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ export function serviceEnvironment(cfg: ResolvedConfig, account: string): Record
return env;
}

/** MODEL_PROVIDER and the Bedrock model mapping (nothing for the default Anthropic API). */
/**
* MODEL_PROVIDER and the Bedrock model mapping (nothing for the default
* Anthropic API). On a self-hosted install this is only the first-boot
* default: an admin can switch in Settings, System, Models at any time
* (services/common/src/model_provider.rs).
*/
export function modelProviderEnvironment(cfg: ResolvedConfig): Record<string, string> {
if (cfg.models.provider !== "bedrock") return {};
return {
Expand All @@ -63,11 +68,27 @@ export function modelProviderEnvironment(cfg: ResolvedConfig): Record<string, st
};
}

/** Bedrock access for Claude models when the provider is Bedrock. */
/**
* Whether the services may call Claude on Bedrock: when the config picks
* Bedrock, and on every self-hosted install (an admin can switch to Bedrock
* in Settings at any time, with no redeploy).
*/
export function mayCallBedrock(cfg: ResolvedConfig): boolean {
return cfg.models.provider === "bedrock" || cfg.layout === "single-origin";
}

/**
* Calling Claude on Bedrock: InvokeModel (which also covers the Converse
* API) and InvokeModelWithResponseStream (ConverseStream), on Anthropic
* models and this account's inference profiles, nothing else. Never
* aws-marketplace:Subscribe or the model agreement and use case calls:
* accepting Anthropic's terms stays a person's action in the console.
*/
export function modelPolicyStatements(cfg: ResolvedConfig, scope: cdk.Stack): iam.PolicyStatement[] {
if (cfg.models.provider !== "bedrock") return [];
if (!mayCallBedrock(cfg)) return [];
return [
new iam.PolicyStatement({
sid: "CallClaudeOnBedrock",
actions: ["bedrock:InvokeModel", "bedrock:InvokeModelWithResponseStream"],
resources: [
// Anthropic models in any region an inference profile routes to,
Expand Down
Loading
Loading