Commit Graph
61 Commits
Author SHA1 Message Date
Kane Zhu b4800c54a0 feat: add prompt caching support for Claude and Nova models
Add comprehensive prompt caching support with flexible control options:

Features:
- ENV variable control (ENABLE_PROMPT_CACHING, default: false)
- Per-request control via extra_body.prompt_caching
- Pattern-based model detection (Claude, Nova)
- Token limit warnings (Nova 20K limit)
- OpenAI-compatible response format (prompt_tokens_details.cached_tokens)

Supported models:
- Claude 3+ models (anthropic.claude-*)
- Nova models (amazon.nova-*)
- Auto-detection prevents breaking unsupported models

Implementation:
- System prompts caching via extra_body.prompt_caching.system
- Messages caching via extra_body.prompt_caching.messages
- Non-streaming and streaming modes
- Compatible with reasoning, thinking, and tool calls
2025-10-15 11:03:19 +08:00
Li Yi 9cea7f9314 chore: polish code with little update (#182)
- Run Docker container as non-root user (appuser) to minimize security risks
- Add Docker HEALTHCHECK for better container orchestration
- Make CORS configurable via ALLOWED_ORIGINS env var with security warning
- Replace assertions with proper error handling (TypeError/ValueError)
- Add 30s timeout to HTTP requests to prevent hanging connections
- Disable auto-reload in production uvicorn settings
2025-10-11 14:49:18 +08:00
Fabian Franz 8177876e5e Support <think> tags (#117) 2025-09-30 20:29:19 +08:00
Neil Mazumdar 66cb51bb36 feat: add Claude Sonnet 4.5 support with global cross-region inference (#180)
This commit adds comprehensive support for Claude Sonnet 4.5 (claude-sonnet-4-5-20250929),
Anthropic's most intelligent model with enhanced coding capabilities and complex agent support.

Changes:
- Added global cross-region inference profile discovery (global.anthropic.*)
- Fixed temperature/topP compatibility for Claude Sonnet 4.5 (model doesn't support both simultaneously)
- Fixed reasoning_effort parameter handling to prevent KeyError
- Added extended thinking/interleaved thinking support via extra_body parameter
- Updated documentation with Claude Sonnet 4.5 examples (English and Chinese)
- Updated README with Sonnet 4.5 announcement

Technical Details:
- src/api/models/bedrock.py: Added global profile support in list_bedrock_models()
- src/api/models/bedrock.py: Added Claude Sonnet 4.5 detection to remove topP parameter
- src/api/models/bedrock.py: Changed pop("topP") to pop("topP", None) to prevent KeyError
- docs/Usage.md: Added Chat Completions section with Sonnet 4.5 examples
- docs/Usage.md: Updated Interleaved thinking section with Sonnet 4.5 examples
- docs/Usage_CN.md: Added Chinese versions of all Sonnet 4.5 documentation

Model ID: global.anthropic.claude-sonnet-4-5-20250929-v1:0
2025-09-30 16:51:26 +08:00
jbrockettandJeremy Brockett 911dfe26d6 models: fix Application Inference Profiles mapping (#175)
* models: fix Application Inference Profiles mapping to include all profiles per model_id; switch to defaultdict(set) and emit all AIPs

* Fix rebase issue

---------

Co-authored-by: Jeremy Brockett <313937+jbrockett@users.noreply.github.com>
2025-08-14 15:21:14 +08:00
RizviRandRizvi Rahim a2110ff648 Add pagination to list_inference_profiles calls (#173)
Co-authored-by: Rizvi Rahim <rizvi@rizvir.com>
2025-08-13 10:26:34 +08:00
heisenbergye 3f1b56a526 feat: support Claude 4 Interleaved thinking (beta) (#164) 2025-07-21 16:44:21 +08:00
Mengxin Zhu 76a3614f17 fix: properly handle tool_use messages in conversation 2025-06-30 00:14:26 +08:00
Gagan MandMengxin Zhu 01836087b1 feat: add support to include application inference profiles as models (#131)
---------

Co-authored-by: Mengxin Zhu <843303+zxkane@users.noreply.github.com>
2025-06-23 22:49:27 +08:00
Zack Elias 844efec086 add titan G1 embeddings (#152) 2025-06-17 11:09:22 +08:00
UniMa007 aed57307bc Add Titan Embeddings G2 (#94) 2025-05-27 21:52:15 +08:00
Aiden Dai 4e8a913e43 fix empty content issue 2025-04-20 09:21:47 +08:00
Aiden Dai b27e83624f fix typo 2025-03-26 13:10:07 +08:00
Aiden Dai c98e123c8f optimize error response in streaming 2025-03-26 11:32:39 +08:00
Aiden Dai 4f1a75b49f fix potential process stuck issue 2025-03-22 18:39:08 +08:00
Aiden Dai 0ead770069 performance improvement 2025-03-13 18:24:08 +08:00
Aiden Dai fa14ae8c05 apply ruff linter 2025-03-13 14:24:41 +08:00
Aiden Dai f21b9a2e84 apply ruff linter 2025-03-13 13:50:57 +08:00
Zhongsheng Ji fcfebf9d9d feat: Response 429 if ThrottlingException (#91) 2025-03-10 09:01:33 +08:00
Aiden Dai a46e329c97 Support of reasoning 2025-02-26 12:25:38 +08:00
Omri Shaiko 54f4a2b017 Fix issue with toolResult error with Cursor. Use default DEFAULT_MODEL in ChatRequest (#110) 2025-02-26 10:43:44 +08:00
Aiden Dai 3ce47ff278 Partial support of reasoning 2025-02-25 16:23:06 +08:00
Aiden Dai c39f6bc942 Use secrets manager for api key 2025-02-10 15:25:12 +08:00
yytdfc 093c6fa586 add stop parameter (#86) 2024-12-31 11:15:24 +08:00
Aiden Dai b2c187c716 Increase connect timeout 2024-12-19 16:45:18 +08:00
Aiden Dai 29621ae59c Automatically detect model list 2024-12-16 16:15:09 +08:00
Aiden Dai d4938a0af2 Automatically detect model list 2024-12-16 16:01:59 +08:00
Fabio NonatoandFabio Nonato 4fc0d3bc94 Image error fix (#80)
---------

Co-authored-by: Fabio Nonato <fnp@amazon.com>
2024-12-11 11:26:51 +08:00
Fabian Fischer 25b3cfb146 feat: add amazon nova inference profiles in us (#79) 2024-12-06 13:52:50 +08:00
mschfh 17503b032a Add cross-region inference profiles for Llama 3.2 models. (#75) 2024-12-05 11:22:11 +08:00
bkocik 6849ca828a Add cross-region inference profiles for Llama 3.1 models. (#72) 2024-11-20 09:57:35 +08:00
KAEYL98 11a31b5584 feat: add support for APAC claude 3 profiles (#69) 2024-11-07 16:43:15 +08:00
heisenbergye 5f7676608a suppot all Claude models Cross-Region Inference (#65) 2024-10-29 14:43:31 +08:00
Sergei Mikhailov 3a97677b97 Added "new Claude 3.5 Sonnet" v2 model to the list (#60) 2024-10-23 14:54:45 +08:00
Yuki Sekiya c655f50616 feat: Handle multiple user messages in a single request (#26) 2024-10-09 15:13:58 +08:00
diopres db0817392f feat: add support for Mistral Large 2 (24.07)
added support for Mistral Large 2 (24.07)
2024-08-12 19:06:44 +05:30
Aiden Dai 2950c15ecb Fix empty response bug 2024-08-09 17:28:09 +08:00
Aiden Dai f8faf32a76 Add Llama 3.1 without tool call 2024-07-30 12:27:08 +08:00
Aiden Dai 66bdfdf5c1 Support Claude 3.5 Sonnet 2024-06-21 10:28:04 +08:00
Aiden Dai 49dd6608a0 Support of tool choice 2024-06-21 10:24:11 +08:00
Aiden Dai b3509ee0f0 Support multiple tool calls 2024-06-11 16:58:26 +08:00
Aiden Dai 56786f9e32 Update api response 2024-06-11 10:53:56 +08:00
Aiden Dai 6ef7641a0d Update api response 2024-06-07 10:58:44 +08:00
Aiden Dai 5f84cef13a Refactor to use new Converse API 2024-06-04 17:01:06 +08:00
Aiden Dai 696039053d Refactor to use new Converse API 2024-06-04 14:59:40 +08:00
Aiden Dai 9f6b334385 Refactor model implementation 2024-05-09 16:58:04 +08:00
Aiden Dai 180c199da9 Add base64 encoded embedding support 2024-04-26 13:46:46 +08:00
Aiden Dai 0512a9b8cc Add Llama 3 support 2024-04-23 10:30:57 +08:00
Aiden Dai 7416f9a4e2 Clean up code 2024-04-18 16:22:06 +08:00
yhx 7df5617037 Add support of anthropic.claude-3-opus-20240229-v1:0 model 2024-04-17 14:22:46 +08:00