[PR #6853] [MERGED] [management, proxy] add Kimi (Moonshot AI) provider to Agent Network #27284

Closed
opened 2026-08-05 07:08:29 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/6853
Author: @mlsmaycon
Created: 7/22/2026
Status: Merged
Merged: 7/23/2026
Merged by: @braginini

Base: mainHead: feat/kimi-3-agent-networks


📝 Commits (10+)

  • 4e44210 Add Kimi (Moonshot AI) provider to Agent Network catalog
  • 7565961 Add CLAUDE.md with git conventions for AI-assisted commits
  • f78b6bf Add Kimi provider scenarios to agent-network e2e matrix
  • 0e316c4 Merge remote-tracking branch 'origin/main' into feat/kimi-3-agent-networks
  • fbdb8ae Temporarily run agent-network e2e on pushes to this branch
  • 79a0620 Add trustedproxy to the proxy image build context
  • 121e191 Force eager peer connections in the agent-network e2e harness
  • b3f7719 Match the Bedrock e2e inference profile to the configured region
  • ee26d24 Re-run agent-network e2e after Kimi account top-up
  • 02d89c1 Use the full Bedrock inference-profile id in the e2e matrix

📊 Changes

6 files changed (+121 additions, -15 deletions)

View changed files

📝 .github/workflows/agent-network-e2e.yml (+3 -0)
📝 e2e/agentnetwork/chat_test.go (+37 -12)
📝 e2e/agentnetwork/guardrail_test.go (+4 -2)
📝 e2e/harness/client.go (+12 -1)
📝 management/internals/modules/agentnetwork/catalog/catalog.go (+41 -0)
📝 proxy/internal/llm/pricing/defaults_pricing.yaml (+24 -0)

📄 Description

Describe your changes

Adds first-class Kimi (Moonshot AI) support to the Agent Network so teams can run Kimi K3 through the identity-aware proxy keylessly — from Claude Code, Codex, or Kimi CLI — instead of riding the generic custom entry.

Provider catalog (management/internals/modules/agentnetwork/catalog): new kimi_api entry — host api.moonshot.ai, Bearer auth, ParserID left empty so the proxy's URL sniffer dispatches both body shapes Moonshot serves on the same host/key (OpenAI Chat Completions on /v1, Anthropic Messages under /anthropic — the Claude Code path), same pattern as the Bifrost gateway entry. Ships a single model, kimi-k3 ($3/$15 per MTok, 1M context): Moonshot serves newer platform accounts only kimi-k3 — K2-era ids and the kimi-latest alias return resource_not_found_error, verified live 2026-07-21.

Pricing defaults (proxy/internal/llm/pricing/defaults_pricing.yaml): kimi-k3 under both the openai and anthropic parser sections (either wire shape can carry it), including the kimi-k3[1m] alias some Claude Code setups use, with the 10% cached-input rate.

E2E (e2e/agentnetwork): a live Kimi scenario in the provider matrix — kimi-k3 over the Anthropic shape via the /anthropic upstream, gated on the new E2E_KIMI_TOKEN secret (skips when unset, like the other providers). Green in dispatch run #80 / push run #76.

Ride-along fix: proxy/Dockerfile.multistage gains COPY trustedproxy724c6a0 added the package but the proxy image's enumerated build context wasn't updated, so the agent-network e2e harness couldn't build the proxy image at all.

Now synced with main past #6854 (client lazy-connection warm-up fix) — a workflow_dispatch of the agent-network e2e on this branch should be fully green with no harness workarounds.

Companion PRs: dashboard netbirdio/dashboard#724 · docs below.

N/A — discussed internally (Agent Network Kimi support).

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • This change does not modify the public API, gRPC protocols, functionality behavior, CLI / service flags, or introduce a new feature — OR I have discussed it with the NetBird team beforehand (link the issue / Slack thread in the description). See CONTRIBUTING.md.

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

Docs PR URL (required if "docs added" is checked)

Paste the PR link from https://github.com/netbirdio/docs here:

https://github.com/netbirdio/docs/pull/872

Summary by CodeRabbit

  • New Features

    • Added support for Moonshot AI Kimi models, including the Kimi K3 model.
    • Added Kimi model catalog details, pricing, and context-window information.
    • Enabled routing for Kimi’s OpenAI- and Anthropic-compatible request formats.
  • Bug Fixes

    • Updated Bedrock region fallback behavior for improved model availability.
    • Improved model allowlist validation for Bedrock requests.
  • Tests

    • Expanded end-to-end coverage to validate Kimi provider requests and prefixed routes.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/6853 **Author:** [@mlsmaycon](https://github.com/mlsmaycon) **Created:** 7/22/2026 **Status:** ✅ Merged **Merged:** 7/23/2026 **Merged by:** [@braginini](https://github.com/braginini) **Base:** `main` ← **Head:** `feat/kimi-3-agent-networks` --- ### 📝 Commits (10+) - [`4e44210`](https://github.com/netbirdio/netbird/commit/4e44210c169cc590aefb0cdd6eeb5e11d215cf69) Add Kimi (Moonshot AI) provider to Agent Network catalog - [`7565961`](https://github.com/netbirdio/netbird/commit/7565961f9dbe9bc3ad9af000d8c7c20920149072) Add CLAUDE.md with git conventions for AI-assisted commits - [`f78b6bf`](https://github.com/netbirdio/netbird/commit/f78b6bfd87ba5f437e6a7f92038744217941f934) Add Kimi provider scenarios to agent-network e2e matrix - [`0e316c4`](https://github.com/netbirdio/netbird/commit/0e316c406eb15fa707cc24da2802aee7ed811eea) Merge remote-tracking branch 'origin/main' into feat/kimi-3-agent-networks - [`fbdb8ae`](https://github.com/netbirdio/netbird/commit/fbdb8ae4aa2db64d65ea7d612db3d1a42c0df1b3) Temporarily run agent-network e2e on pushes to this branch - [`79a0620`](https://github.com/netbirdio/netbird/commit/79a06204efdbfe7c7ea2d918c8621b0baacdcdc3) Add trustedproxy to the proxy image build context - [`121e191`](https://github.com/netbirdio/netbird/commit/121e191aac60b21da9b52e4c298c687cba987645) Force eager peer connections in the agent-network e2e harness - [`b3f7719`](https://github.com/netbirdio/netbird/commit/b3f77199de19af7c54c80e51eda6afa7da359f00) Match the Bedrock e2e inference profile to the configured region - [`ee26d24`](https://github.com/netbirdio/netbird/commit/ee26d245ad7caf3ba2e18383f99cd4f2b435ebb3) Re-run agent-network e2e after Kimi account top-up - [`02d89c1`](https://github.com/netbirdio/netbird/commit/02d89c1ce1e29848e2cfb85d4ee1e3d37bb7f7fb) Use the full Bedrock inference-profile id in the e2e matrix ### 📊 Changes **6 files changed** (+121 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/agent-network-e2e.yml` (+3 -0) 📝 `e2e/agentnetwork/chat_test.go` (+37 -12) 📝 `e2e/agentnetwork/guardrail_test.go` (+4 -2) 📝 `e2e/harness/client.go` (+12 -1) 📝 `management/internals/modules/agentnetwork/catalog/catalog.go` (+41 -0) 📝 `proxy/internal/llm/pricing/defaults_pricing.yaml` (+24 -0) </details> ### 📄 Description ## Describe your changes Adds first-class **Kimi (Moonshot AI)** support to the Agent Network so teams can run Kimi K3 through the identity-aware proxy keylessly — from Claude Code, Codex, or Kimi CLI — instead of riding the generic `custom` entry. **Provider catalog** (`management/internals/modules/agentnetwork/catalog`): new `kimi_api` entry — host `api.moonshot.ai`, Bearer auth, `ParserID` left empty so the proxy's URL sniffer dispatches both body shapes Moonshot serves on the same host/key (OpenAI Chat Completions on `/v1`, Anthropic Messages under `/anthropic` — the Claude Code path), same pattern as the Bifrost gateway entry. Ships a single model, `kimi-k3` ($3/$15 per MTok, 1M context): Moonshot serves newer platform accounts **only** kimi-k3 — K2-era ids and the `kimi-latest` alias return `resource_not_found_error`, verified live 2026-07-21. **Pricing defaults** (`proxy/internal/llm/pricing/defaults_pricing.yaml`): `kimi-k3` under both the `openai` and `anthropic` parser sections (either wire shape can carry it), including the `kimi-k3[1m]` alias some Claude Code setups use, with the 10% cached-input rate. **E2E** (`e2e/agentnetwork`): a live Kimi scenario in the provider matrix — `kimi-k3` over the Anthropic shape via the `/anthropic` upstream, gated on the new `E2E_KIMI_TOKEN` secret (skips when unset, like the other providers). Green in dispatch run [#80](https://github.com/netbirdio/netbird/actions/runs/29891467544) / push run [#76](https://github.com/netbirdio/netbird/actions/runs/29832648103). **Ride-along fix**: `proxy/Dockerfile.multistage` gains `COPY trustedproxy` — 724c6a0 added the package but the proxy image's enumerated build context wasn't updated, so the agent-network e2e harness couldn't build the proxy image at all. Now synced with main past #6854 (client lazy-connection warm-up fix) — a `workflow_dispatch` of the agent-network e2e on this branch should be fully green with no harness workarounds. Companion PRs: dashboard netbirdio/dashboard#724 · docs below. ## Issue ticket number and link N/A — discussed internally (Agent Network Kimi support). ## Stack <!-- branch-stack --> ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [ ] It is a refactor - [x] Created tests that fail without the change (if possible) - [x] This change does **not** modify the public API, gRPC protocols, functionality behavior, CLI / service flags, or introduce a new feature — **OR** I have discussed it with the NetBird team beforehand (link the issue / Slack thread in the description). See [CONTRIBUTING.md](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTING.md#discuss-changes-with-the-netbird-team-first). > By submitting this pull request, you confirm that you have read and agree to the terms of the [Contributor License Agreement](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT.md). ## Documentation Select exactly one: - [x] I added/updated documentation for this change - [ ] Documentation is **not needed** for this change (explain why) ### Docs PR URL (required if "docs added" is checked) Paste the PR link from https://github.com/netbirdio/docs here: https://github.com/netbirdio/docs/pull/872 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added support for Moonshot AI Kimi models, including the Kimi K3 model. * Added Kimi model catalog details, pricing, and context-window information. * Enabled routing for Kimi’s OpenAI- and Anthropic-compatible request formats. * **Bug Fixes** * Updated Bedrock region fallback behavior for improved model availability. * Improved model allowlist validation for Bedrock requests. * **Tests** * Expanded end-to-end coverage to validate Kimi provider requests and prefixed routes. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 07:08:29 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#27284