[PR #1503] [MERGED] feat: enhance Bedrock plugin with per-model pricing support #1929

Closed
opened 2026-02-16 11:15:15 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify-official-plugins/pull/1503
Author: @akshaysinghas
Created: 8/13/2025
Status: Merged
Merged: 8/13/2025
Merged by: @crazywoola

Base: mainHead: main


📝 Commits (3)

  • afcad05 feat: implement per-model pricing for Bedrock plugin
  • e54df73 feat: enhance Bedrock plugin with per-model pricing and improved organization
  • ceb13dc chore: bump version to 0.0.31

📊 Changes

23 files changed (+1612 additions, -11 deletions)

View changed files

models/bedrock/.difyignore (+12 -0)
📝 models/bedrock/manifest.yaml (+1 -1)
models/bedrock/models/llm/_position.yaml (+7 -0)
models/bedrock/models/llm/cohere.yaml (+77 -0)
📝 models/bedrock/models/llm/llm.py (+210 -6)
models/bedrock/models/llm/model_configurations/claude-3-5-haiku.yaml (+100 -0)
models/bedrock/models/llm/model_configurations/claude-3-5-sonnet.yaml (+100 -0)
models/bedrock/models/llm/model_configurations/claude-3-7-sonnet.yaml (+100 -0)
models/bedrock/models/llm/model_configurations/claude-3-haiku.yaml (+100 -0)
models/bedrock/models/llm/model_configurations/claude-3-opus.yaml (+100 -0)
models/bedrock/models/llm/model_configurations/claude-3-sonnet.yaml (+100 -0)
models/bedrock/models/llm/model_configurations/claude-4-opus.yaml (+100 -0)
models/bedrock/models/llm/model_configurations/claude-4-sonnet.yaml (+100 -0)
models/bedrock/models/llm/model_configurations/cohere-command-light.yaml (+62 -0)
models/bedrock/models/llm/model_configurations/cohere-command-r.yaml (+62 -0)
models/bedrock/models/llm/model_configurations/cohere-command-rplus.yaml (+62 -0)
models/bedrock/models/llm/model_configurations/cohere-command.yaml (+62 -0)
models/bedrock/models/llm/model_configurations/nova-lite.yaml (+81 -0)
models/bedrock/models/llm/model_configurations/nova-micro.yaml (+81 -0)
models/bedrock/models/llm/model_configurations/nova-pro.yaml (+81 -0)

...and 3 more files

📄 Description

Summary

  • Implement per-model pricing for Bedrock plugin while maintaining backward compatibility
  • Add comprehensive model configurations for accurate AWS pricing
  • Support Claude 3.7 Sonnet with correct pricing structure
  • Organize individual model configurations in dedicated directory

Key Features

  • Per-model pricing: Individual pricing for Claude, Nova, and Cohere model variants
  • Backward compatibility: Preserved family-based model UI grouping
  • Enhanced pricing logic: Robust fallback system supporting multiple pricing formats
  • Claude 3.7 Sonnet: Added with accurate AWS pricing ($0.003/$0.015 per 1K tokens)
  • Cohere embedding models: Updated with correct pricing ($0.0001 per 1K tokens)

Technical Changes

  • Added model_configurations/ directory for individual model pricing definitions
  • Enhanced _get_model_specific_pricing() method with format variant matching
  • Implemented dict/object pricing format compatibility
  • Updated embedding model pricing to reflect current AWS rates
  • Maintained inference profile compatibility

Test Plan

  • Verify per-model pricing calculation accuracy
  • Confirm family model UI preserved for backward compatibility
  • Test Claude 3.7 Sonnet pricing functionality
  • Validate Cohere embedding model pricing
  • Ensure inference profiles work with new pricing system
Screenshot 2025-08-13 at 12 51 33 PM Screenshot 2025-08-13 at 12 51 11 PM  Before pics Screenshot 2025-08-13 at 7 58 54 PM Screenshot 2025-08-13 at 7 58 44 PM After pics Nova pro Screenshot 2025-08-13 at 8 06 55 PM Claude 4 Screenshot 2025-08-13 at 8 09 13 PM Inference profile Screenshot 2025-08-13 at 8 10 03 PM Screenshot 2025-08-13 at 8 10 20 PM

🔄 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/langgenius/dify-official-plugins/pull/1503 **Author:** [@akshaysinghas](https://github.com/akshaysinghas) **Created:** 8/13/2025 **Status:** ✅ Merged **Merged:** 8/13/2025 **Merged by:** [@crazywoola](https://github.com/crazywoola) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (3) - [`afcad05`](https://github.com/langgenius/dify-official-plugins/commit/afcad056e0571b66088ebc1b65f29a9ba09e8886) feat: implement per-model pricing for Bedrock plugin - [`e54df73`](https://github.com/langgenius/dify-official-plugins/commit/e54df7397e85e7e413f3fa94d11da6a6286a4e43) feat: enhance Bedrock plugin with per-model pricing and improved organization - [`ceb13dc`](https://github.com/langgenius/dify-official-plugins/commit/ceb13dc6b46a33201425782d5c5ae8756836ac37) chore: bump version to 0.0.31 ### 📊 Changes **23 files changed** (+1612 additions, -11 deletions) <details> <summary>View changed files</summary> ➕ `models/bedrock/.difyignore` (+12 -0) 📝 `models/bedrock/manifest.yaml` (+1 -1) ➕ `models/bedrock/models/llm/_position.yaml` (+7 -0) ➕ `models/bedrock/models/llm/cohere.yaml` (+77 -0) 📝 `models/bedrock/models/llm/llm.py` (+210 -6) ➕ `models/bedrock/models/llm/model_configurations/claude-3-5-haiku.yaml` (+100 -0) ➕ `models/bedrock/models/llm/model_configurations/claude-3-5-sonnet.yaml` (+100 -0) ➕ `models/bedrock/models/llm/model_configurations/claude-3-7-sonnet.yaml` (+100 -0) ➕ `models/bedrock/models/llm/model_configurations/claude-3-haiku.yaml` (+100 -0) ➕ `models/bedrock/models/llm/model_configurations/claude-3-opus.yaml` (+100 -0) ➕ `models/bedrock/models/llm/model_configurations/claude-3-sonnet.yaml` (+100 -0) ➕ `models/bedrock/models/llm/model_configurations/claude-4-opus.yaml` (+100 -0) ➕ `models/bedrock/models/llm/model_configurations/claude-4-sonnet.yaml` (+100 -0) ➕ `models/bedrock/models/llm/model_configurations/cohere-command-light.yaml` (+62 -0) ➕ `models/bedrock/models/llm/model_configurations/cohere-command-r.yaml` (+62 -0) ➕ `models/bedrock/models/llm/model_configurations/cohere-command-rplus.yaml` (+62 -0) ➕ `models/bedrock/models/llm/model_configurations/cohere-command.yaml` (+62 -0) ➕ `models/bedrock/models/llm/model_configurations/nova-lite.yaml` (+81 -0) ➕ `models/bedrock/models/llm/model_configurations/nova-micro.yaml` (+81 -0) ➕ `models/bedrock/models/llm/model_configurations/nova-pro.yaml` (+81 -0) _...and 3 more files_ </details> ### 📄 Description ## Summary - Implement per-model pricing for Bedrock plugin while maintaining backward compatibility - Add comprehensive model configurations for accurate AWS pricing - Support Claude 3.7 Sonnet with correct pricing structure - Organize individual model configurations in dedicated directory ## Key Features - **Per-model pricing**: Individual pricing for Claude, Nova, and Cohere model variants - **Backward compatibility**: Preserved family-based model UI grouping - **Enhanced pricing logic**: Robust fallback system supporting multiple pricing formats - **Claude 3.7 Sonnet**: Added with accurate AWS pricing ($0.003/$0.015 per 1K tokens) - **Cohere embedding models**: Updated with correct pricing ($0.0001 per 1K tokens) ## Technical Changes - Added `model_configurations/` directory for individual model pricing definitions - Enhanced `_get_model_specific_pricing()` method with format variant matching - Implemented dict/object pricing format compatibility - Updated embedding model pricing to reflect current AWS rates - Maintained inference profile compatibility ## Test Plan - [x] Verify per-model pricing calculation accuracy - [x] Confirm family model UI preserved for backward compatibility - [x] Test Claude 3.7 Sonnet pricing functionality - [x] Validate Cohere embedding model pricing - [x] Ensure inference profiles work with new pricing system <img width="1332" height="525" alt="Screenshot 2025-08-13 at 12 51 33 PM" src="https://github.com/user-attachments/assets/18166639-8cde-4872-bd8e-988fdd9df700" /> <img width="1306" height="691" alt="Screenshot 2025-08-13 at 12 51 11 PM" src="https://github.com/user-attachments/assets/3e55974a-ddcb-4941-99c6-4375fbf82e85" /> <img width="1286" height="713" alt=" " src="https://github.com/user-attachments/assets/66e80fee-9bc0-4c2d-8e6f-c46039affc30" /> Before pics <img width="497" height="892" alt="Screenshot 2025-08-13 at 7 58 54 PM" src="https://github.com/user-attachments/assets/32abfb63-7338-4802-9672-f21d9431e8cb" /> <img width="448" height="848" alt="Screenshot 2025-08-13 at 7 58 44 PM" src="https://github.com/user-attachments/assets/38cc3b26-0834-436f-a5b5-3e86bb7b05dd" /> After pics Nova pro <img width="511" height="945" alt="Screenshot 2025-08-13 at 8 06 55 PM" src="https://github.com/user-attachments/assets/4a68565a-2a47-4b27-b636-1b4d851b0922" /> Claude 4 <img width="523" height="932" alt="Screenshot 2025-08-13 at 8 09 13 PM" src="https://github.com/user-attachments/assets/b43975e1-97e4-46e8-87c0-4a58be199b15" /> Inference profile <img width="766" height="475" alt="Screenshot 2025-08-13 at 8 10 03 PM" src="https://github.com/user-attachments/assets/410524f6-7dcd-4da4-b535-042530728748" /> <img width="511" height="926" alt="Screenshot 2025-08-13 at 8 10 20 PM" src="https://github.com/user-attachments/assets/f94bd69b-0b0b-4256-86a9-1ad3ef38ea22" /> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 11:15:15 -05:00
yindo closed this issue 2026-02-16 11:15:15 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#1929