Skip to content

mannjaro/serverless-bedrock-proxy

Repository files navigation

Bedrock Proxy

This repository contains a serverless application built with AWS CDK, Hono, and Zod. The application serves as a proxy for Bedrock, providing a chat interface and handling various chat-related requests and responses.

Table of Contents

Installation

To install the dependencies, run:

npm install

Usage

To start the development server, run:

npm run dev

Project Structure

The project is organized as follows:

  • lambda/bedrock-proxy/src/: Contains the source code for the Lambda functions and related schemas.
  • lib/: Contains the AWS CDK constructs and stack definitions.

Schemas

The project uses Zod for schema validation. The schemas are defined in the lambda/bedrock-proxy/src/schema directory.

Response Schemas

The response schemas are defined in lambda/bedrock-proxy/src/schema/response/chat.ts:

Request Schemas

The request schemas are defined in lambda/bedrock-proxy/src/schema/request/chat.ts:

API Endpoints

The API endpoints are defined in lambda/bedrock-proxy/src/api/chat.ts:

/chat/completions

  • Method: POST
  • Description: Handles chat completions.
  • Request Body: Validated against ChatRequestSchema.
  • Response: Returns a chat response.

Deployment

To deploy the project, run:

npm run deploy

This will build the project, create a zip file, and update the Lambda function code.

About

Hosting API Proxy for Bedrock via Lambda function URL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published