Skip to content

Repository files navigation

ThunderSoft API - 纯净版部署包

这是一个纯净版的 ThunderSoft Bedrock API 服务部署包,包含了部署所需的所有核心文件。

项目结构

ThunderSoft_API/
├── README.md                           # 项目说明文档
├── config.py                          # 配置文件
├── requirements.txt                    # Python依赖
├── lambda_function_alb.py             # ALB Lambda函数
├── lambda_function_apigw.py           # API Gateway Lambda函数
├── deployment/                        # 部署相关文件
│   ├── deploy-complete.sh             # 完整部署脚本
│   ├── deployment-config.json         # 部署配置
│   ├── networking-template.yaml       # 网络基础设施模板
│   ├── cloudformation-template.yaml   # ALB CloudFormation模板
│   └── api-gateway-template.yaml      # API Gateway CloudFormation模板
├── services/                          # 服务模块
│   ├── __init__.py
│   ├── authentication_handler.py
│   ├── apigw_authentication_handler.py
│   ├── request_parser.py
│   ├── image_processor.py
│   ├── bedrock_client.py
│   ├── response_formatter.py
│   ├── alb_response_handler.py
│   ├── apigw_response_handler.py
│   ├── apigw_streaming_handler.py
│   ├── stream_handler.py
│   └── error_handler.py
├── models/                            # 数据模型
│   ├── __init__.py
│   ├── request_models.py
│   ├── response_models.py
│   ├── bedrock_models.py
│   ├── auth_models.py
│   └── error_models.py
└── utils/                             # 工具模块
    ├── __init__.py
    ├── logging_utils.py
    └── validation_utils.py

部署说明

  1. 确保已安装 AWS CLI 并配置好凭证
  2. 安装必要的工具:jq 和 bc
  3. 修改 deployment/deployment-config.json 中的配置
  4. 运行部署脚本:bash deployment/deploy-complete.sh

支持的部署模式

  • ALB + Lambda: 稳定的负载均衡器模式
  • API Gateway + Lambda: 支持真正的SSE流式响应
  • Both: 同时部署两种架构进行对比

环境变量

可以通过环境变量控制部署类型:

  • DEPLOYMENT_TYPE=alb - 仅部署ALB模式
  • DEPLOYMENT_TYPE=apigw - 仅部署API Gateway模式
  • DEPLOYMENT_TYPE=both - 部署两种模式

文件说明

  • 所有文件都是部署必需的核心文件
  • 已移除测试文件、文档文件和开发工具
  • 保留了完整的业务逻辑和配置

About

车载多模态大模型推理接口服务(原 ThunderSoft API 纯净版):AWS Lambda 封装 Amazon Bedrock Claude 3.7 Sonnet 的图文推理能力,提供 ALB 与 API Gateway 两种部署模式,后者支持真正的 SSE 流式响应。代码按 services / models / utils 分层,含鉴权、图片处理、流式响应与错误处理模块,附 3 份 CloudFormation 模板与一键部署脚本。

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages