Issue 1 feat plugin add native anthropic streaming and prompt caching support - #2
Open
An-Dongsun wants to merge 5 commits into
Conversation
An-Dongsun
requested review from
Copilot,
kyovant0,
laplacian-k and
sehyun-hwang
February 3, 2026 04:22
11 tasks
There was a problem hiding this comment.
Pull request overview
This PR adds a custom Kong plugin ai-anthropic-native that enables native Anthropic SDK compatibility for AWS Bedrock Claude models. It implements native streaming in Anthropic SSE format (bypassing OpenAI conversion), prompt caching with automatic cache_control injection, and cache metrics exposure via response headers.
Changes:
- New plugin with native Anthropic streaming support (preserves Anthropic SSE format instead of converting to OpenAI)
- Prompt caching support with automatic
cache_controlinjection into system prompts and tools - Cache metrics exposure through custom response headers
- Extended Thinking (Claude 4) support via
thinkingparameter conversion - Full LLM framework fork from Kong AI Proxy including drivers, adapters, and shared filters
Reviewed changes
Copilot reviewed 38 out of 38 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| kong/plugins/ai-anthropic-native/handler.lua | Plugin handler registering custom filters including inject-cache-control and expose-cache-metrics |
| kong/plugins/ai-anthropic-native/schema.lua | Plugin schema with native_streaming, prompt_caching, and expose_cache_metrics configuration |
| kong/llm/plugin/shared-filters/inject-cache-control.lua | Filter to inject cache_control into system prompts and tools for Anthropic prompt caching |
| kong/llm/plugin/shared-filters/expose-cache-metrics.lua | Filter to expose cache metrics as response headers |
| kong/llm/drivers/anthropic.lua | Anthropic driver with native streaming preserve mode support |
| kong/llm/drivers/bedrock.lua | Bedrock driver with Bedrock EventStream to Anthropic SSE conversion and Extended Thinking support |
| kong/llm/adapters/anthropic.lua | Anthropic format adapter for native format passthrough |
| kong/llm/adapters/bedrock.lua | Bedrock format adapter |
| kong/llm/adapters/gemini.lua | Gemini format adapter |
| spec/ai-anthropic-native/*.lua | Schema and unit tests for the plugin |
| kong.yml.template | Configuration template with examples |
| kong-plugin-ai-anthropic-native-0.1.0-1.rockspec | LuaRocks package specification |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
laplacian-k
approved these changes
Feb 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1
Summary
Kong ai-proxy를 Full Fork하여 Native Anthropic Streaming과 Prompt Caching을 지원하는
ai-anthropic-native플러그인 추가Changes
kong/llm/kong/plugins/ai-anthropic-native/kong/llm/plugin/shared-filters/inject-cache-control.luakong/llm/plugin/shared-filters/expose-cache-metrics.luaConfiguration Example