diff --git a/.dockerignore b/.dockerignore
index 86b73183..d86caeca 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -9,6 +9,7 @@ release
release-local
logs
tmp
+.tmp
test-results
playwright-report
blob-report
diff --git a/.github/actions/prepare-release-gateway/action.yml b/.github/actions/prepare-release-gateway/action.yml
new file mode 100644
index 00000000..9d708b92
--- /dev/null
+++ b/.github/actions/prepare-release-gateway/action.yml
@@ -0,0 +1,34 @@
+name: Prepare release gateway
+description: Build the pinned gateway with CCR's regression fixes for release artifacts.
+runs:
+ using: composite
+ steps:
+ - name: Check out pinned gateway source
+ uses: actions/checkout@v4
+ with:
+ repository: The-NeXT-AI/ai-gateway
+ ref: f061ad4371b6cf99d5e248746eac1e4ffdda8980
+ path: .tmp/release-gateway
+
+ - name: Set up Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: 22
+
+ - name: Apply gateway regression fixes
+ shell: bash
+ working-directory: .tmp/release-gateway
+ run: |
+ git apply ../../patches/ai-gateway/0001-fix-tool-ids-and-fusion-traces.patch
+ git apply ../../patches/ai-gateway/0002-complete-native-replay-and-response-status.patch
+
+ - name: Build and verify patched gateway
+ shell: bash
+ working-directory: .tmp/release-gateway
+ run: |
+ npm ci
+ npm run typecheck
+ npx vitest run src/gateway/routes.test.ts src/adapters/builtins/anthropic-tool-id.test.ts
+ npm run build
+ mkdir -p ../../docker/local-ai-gateway
+ npm pack --ignore-scripts --pack-destination ../../docker/local-ai-gateway
diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml
index 625f5ae4..53d54de1 100644
--- a/.github/workflows/docker-release.yml
+++ b/.github/workflows/docker-release.yml
@@ -54,6 +54,9 @@ jobs:
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "major_minor=${version%.*}" >> "$GITHUB_OUTPUT"
+ - name: Prepare patched gateway package
+ uses: ./.github/actions/prepare-release-gateway
+
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index cc319144..82d3a8c0 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -14,7 +14,7 @@ concurrency:
jobs:
model-catalog:
- name: Update model catalog
+ name: Prepare model catalog
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
@@ -26,8 +26,8 @@ jobs:
with:
node-version: 22
- - name: Update models.json
- run: npm run models:update
+ - name: Validate checked-in model catalog
+ run: node -e "JSON.parse(require('node:fs').readFileSync('packages/core/models.json', 'utf8'))"
- name: Upload model catalog
uses: actions/upload-artifact@v4
@@ -37,9 +37,27 @@ jobs:
if-no-files-found: error
retention-days: 1
+ gateway:
+ name: Build patched gateway
+ runs-on: ubuntu-latest
+ steps:
+ - name: Check out repository
+ uses: actions/checkout@v4
+
+ - name: Prepare patched gateway package
+ uses: ./.github/actions/prepare-release-gateway
+
+ - name: Upload patched gateway package
+ uses: actions/upload-artifact@v4
+ with:
+ name: release-patched-gateway
+ path: docker/local-ai-gateway/the-next-ai-ai-gateway-*.tgz
+ if-no-files-found: error
+ retention-days: 1
+
macos:
name: macOS (${{ matrix.display_name }})
- needs: model-catalog
+ needs: [model-catalog, gateway]
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
@@ -70,6 +88,16 @@ jobs:
- name: Install dependencies
run: npm ci
+ - name: Download patched gateway package
+ uses: actions/download-artifact@v4
+ with:
+ name: release-patched-gateway
+ path: .tmp/gateway-package
+
+ - name: Install patched gateway
+ shell: bash
+ run: npm install --no-save --package-lock=false .tmp/gateway-package/*.tgz
+
- name: Download updated model catalog
uses: actions/download-artifact@v4
with:
@@ -186,6 +214,16 @@ jobs:
- name: Install dependencies
run: npm ci
+ - name: Download patched gateway package
+ uses: actions/download-artifact@v4
+ with:
+ name: release-patched-gateway
+ path: .tmp/gateway-package
+
+ - name: Install patched gateway
+ shell: bash
+ run: npm install --no-save --package-lock=false .tmp/gateway-package/*.tgz
+
- name: Download updated model catalog
uses: actions/download-artifact@v4
with:
@@ -224,6 +262,16 @@ jobs:
- name: Install dependencies
run: npm ci
+ - name: Download patched gateway package
+ uses: actions/download-artifact@v4
+ with:
+ name: release-patched-gateway
+ path: .tmp/gateway-package
+
+ - name: Install patched gateway
+ shell: bash
+ run: npm install --no-save --package-lock=false .tmp/gateway-package/*.tgz
+
- name: Download updated model catalog
uses: actions/download-artifact@v4
with:
diff --git a/README.md b/README.md
index a80d9f47..9b604a75 100644
--- a/README.md
+++ b/README.md
@@ -8,11 +8,9 @@
- Kimi Code Subscription
+ Kimi Code plan (中文站 | Global)
·
- API Global
- ·
- API China
+ API (中文站 | Global)
@@ -22,7 +20,7 @@
Thanks to Kimi for sponsoring this project! Kimi K3 is Moonshot AI's most capable model and the world's first open 3T-class model. With 2.8 trillion parameters, native vision, and a 1-million-token context window, K3 delivers frontier performance across long-horizon coding, knowledge work, and reasoning. Inside CCR, Kimi ships as a built-in provider preset: import the pay-as-you-go API or Kimi Code subscription in one click and route your coding agent's requests to Kimi. The subscription endpoint passes through natively without protocol conversion, API endpoints are adapted automatically, and account balance and subscription usage are visible in the CCR dashboard.
- CCR already includes Kimi provider presets. Visit the Kimi Open Platform (中文站 | Global) to try the API, or explore the Kimi Code subscription. + CCR already includes Kimi provider presets. Visit the Kimi Open Platform (中文站 | Global) to try the API, or explore the Kimi Code plan (中文站 | Global).
@@ -169,28 +167,28 @@ CCR supports OpenAI Chat / Responses, Anthropic Messages, Gemini Generate Conten