Skip to content

Commit 522b736

Browse files
vishal veerareddyclaude
andcommitted
fix(init): correct Bedrock + LM Studio wizard schema
Bedrock prompts were producing a non-booting .env because the wizard asked for BEDROCK_API_KEY but the config loader at src/config/index.js:127 reads AWS_BEDROCK_API_KEY. The misleading "or use IAM" hint also implied a SigV4 fallback that doesn't exist — src/clients/databricks.js:1450 throws if the bearer token is missing. LM Studio's default endpoint was http://localhost:1234/v1, but the client at databricks.js:1329 appends /v1/chat/completions to whatever endpoint is supplied. Result was a doubled /v1 in the request URL and 404 responses. Corrected to http://localhost:1234 to match the LM Studio default and the maintainer's working .env. Wizard now also collects AWS_BEDROCK_REGION and AWS_BEDROCK_MODEL_ID when bedrock is picked, with the cross-region inference profile (us.anthropic.claude-sonnet-4-5) as the default. docs/init.md: corrects the providers table row and adds a Bedrock setup subsection covering the bearer-token-vs-IAM nuance, the us./eu. cross-region prefix, model-ID format, and tier syntax with concrete examples for the Anthropic Claude family and Llama. Docker image / labels bumped to 9.7.2. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent c5d215d commit 522b736

5 files changed

Lines changed: 44 additions & 9 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ FROM node:24-alpine AS runtime
2323

2424
ARG VCS_REF
2525
ARG BUILD_DATE
26-
ARG VERSION=9.7.1
26+
ARG VERSION=9.7.2
2727

2828
LABEL org.opencontainers.image.title="Lynkr" \
2929
org.opencontainers.image.description="Universal LLM proxy for Claude Code, Cursor, and AI coding tools" \

bin/lynkr-init.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const PROVIDERS = {
5555
local: true,
5656
creds: [],
5757
extras: [
58-
{ key: 'LMSTUDIO_ENDPOINT', label: 'endpoint', default: 'http://localhost:1234/v1' },
58+
{ key: 'LMSTUDIO_ENDPOINT', label: 'endpoint', default: 'http://localhost:1234' },
5959
],
6060
defaultModel: 'qwen2.5-coder',
6161
},
@@ -112,10 +112,16 @@ const PROVIDERS = {
112112
label: 'AWS Bedrock',
113113
local: false,
114114
creds: [
115-
{ key: 'BEDROCK_API_KEY', label: 'AWS Bedrock API key (or use IAM)', secret: true },
115+
// Bearer token from AWS Console → Bedrock → API Keys. The Bedrock client
116+
// (src/clients/databricks.js:1450) requires this key and does NOT fall
117+
// back to IAM/SigV4 — common misconception worth being explicit about.
118+
{ key: 'AWS_BEDROCK_API_KEY', label: 'AWS Bedrock API key (Bearer token from Bedrock console)', secret: true },
116119
],
117-
extras: [],
118-
defaultModel: 'anthropic.claude-sonnet-4-v1:0',
120+
extras: [
121+
{ key: 'AWS_BEDROCK_REGION', label: 'AWS region', default: 'us-east-1' },
122+
{ key: 'AWS_BEDROCK_MODEL_ID', label: 'Default model ID', default: 'us.anthropic.claude-sonnet-4-5-20250929-v1:0' },
123+
],
124+
defaultModel: 'us.anthropic.claude-sonnet-4-5-20250929-v1:0',
119125
},
120126
vertex: {
121127
label: 'Google Vertex AI',

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ services:
33
lynkr:
44
build: .
55
container_name: lynkr
6-
image: lynkr:9.7.1
6+
image: lynkr:9.7.2
77
ports:
88
- "8081:8081"
99
extra_hosts:
@@ -337,7 +337,7 @@ services:
337337
retries: 3
338338
start_period: 40s
339339
labels:
340-
- "com.lynkr.version=9.7.1"
340+
- "com.lynkr.version=9.7.2"
341341
- "com.lynkr.description=Claude Code proxy with multi-provider support"
342342
# Uncomment to set resource limits
343343
# deploy:

docs/init.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,42 @@ The wizard covers everything in `src/config/index.js` `SUPPORTED_MODEL_PROVIDERS
7777
| `openai` | | `OPENAI_API_KEY` |
7878
| `openrouter` | | `OPENROUTER_API_KEY` |
7979
| `databricks` | | `DATABRICKS_API_BASE`, `DATABRICKS_API_KEY` |
80-
| `bedrock` | | `BEDROCK_API_KEY` (or IAM credentials) |
80+
| `bedrock` | | `AWS_BEDROCK_API_KEY` (Bearer token; no IAM fallback). See [Bedrock setup](#bedrock-setup) below. |
8181
| `vertex` | | `VERTEX_API_KEY` (or Application Default Credentials) |
8282
| `zai` | | `ZAI_API_KEY` |
8383
| `moonshot` | | `MOONSHOT_API_KEY` |
8484

8585
Local providers skip the credential prompt entirely.
8686

87+
### Bedrock setup
88+
89+
Bedrock differs from the other cloud providers in a few ways that trip people
90+
up. The wizard handles all of this if you pick `bedrock` for a tier, but the
91+
details are:
92+
93+
- **Authentication is Bearer-token only.** Lynkr's Bedrock client
94+
(`src/clients/databricks.js:1450`) requires `AWS_BEDROCK_API_KEY` and does
95+
**not** fall back to AWS IAM / SigV4 / Application Default Credentials.
96+
Generate the key at *AWS Console → Bedrock → API Keys*.
97+
- **Region** is picked from `AWS_BEDROCK_REGION`, falling back to `AWS_REGION`,
98+
then `us-east-1`.
99+
- **Model IDs use the `<region>.<vendor>.<model>` format.** Use the
100+
cross-region inference prefix (`us.`, `eu.`, etc.) for higher availability:
101+
102+
```
103+
TIER_SIMPLE=bedrock:us.anthropic.claude-haiku-4-20250514-v1:0
104+
TIER_MEDIUM=bedrock:us.anthropic.claude-sonnet-4-20250514-v1:0
105+
TIER_COMPLEX=bedrock:us.anthropic.claude-sonnet-4-5-20250929-v1:0
106+
TIER_REASONING=bedrock:us.anthropic.claude-opus-4-1-20250915-v1:0
107+
```
108+
109+
Non-Anthropic Bedrock models work too with the same `bedrock:<modelId>`
110+
syntax — e.g. `bedrock:meta.llama3-1-70b-instruct-v1:0`.
111+
- **Prompt-cache injection is auto-stripped** before dispatch. Bedrock's
112+
Converse API rejects `cache_control` blocks, so `normalizeBodyForConverse`
113+
(databricks.js:1477) drops them. You don't have to disable prompt caching
114+
globally.
115+
87116
---
88117

89118
## What ends up in `.env`

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lynkr",
3-
"version": "9.7.1",
3+
"version": "9.7.2",
44
"description": "Self-hosted LLM gateway and tier-routing proxy for Claude Code, Cursor, and Codex. Routes across Ollama, AWS Bedrock, OpenRouter, Databricks, Azure OpenAI, llama.cpp, and LM Studio with prompt caching, MCP tools, and 60-80% cost savings.",
55
"main": "index.js",
66
"bin": {

0 commit comments

Comments
 (0)