Coder Social home page Coder Social logo

bedrock-claude-codecoach's Introduction

Bedrock Claude CodeCoach

This repository is a sample code coach(include code interpreter ) using the Anthropic company's LLM Claude 2, one of the foundational models provided by Amazon Bedrock for generative AI. This sample is an innovative tool designed to assist developers in writing efficient and high-quality code .

Architecture

It's an architecture built on AWS managed services, eliminating the need for infrastructure management. Utilizing Amazon Bedrock, there's no need to communicate with APIs outside of AWS. This enables deploying scalable, reliable, and secure applications.

Demo

codecoach-demo.mp4

CodeCoach Vimeo link:

Features and Roadmap

  • Authentication (Sign-up, Sign-in)

  • IAM Role, AK/SK, Cognito identity support

  • Docker Image

  • Docker Compose deploy file

  • Export chat history

  • Syntax highlighting for code

  • Rendering of Markdown'

  • Streaming Response

  • Python runtime support

  • PHP runtime support

  • golang runtime support

  • "How to fix " support

  • CDN support

  • ECS support

  • Install script

  • Cloudfromation/ CDK deployment script

Deployment

  1. Require: Amazon Bedrock Claude and DynamoDB access permession.

  2. Launch EC2 instance , amazon linux 2023, m5.large, security group open 3000 , craete IAM Role for it that need DynamoDB and Bedrock Access permession.

  3. Create a DynamoDB table with the default table name "bedrock-claude-codecoach-users". The password needs to be sha1 encoded, any you can use some online tools such as https://codebeautify.org/sha1-hash-generator to generate it.

    aws dynamodb create-table \
        --table-name bedrock-claude-codecoach-users \
        --attribute-definitions \
            AttributeName=email,AttributeType=S \
        --key-schema \
            AttributeName=email,KeyType=HASH \
        --provisioned-throughput \
            ReadCapacityUnits=5,WriteCapacityUnits=5
    
    #change your password
    aws dynamodb put-item \
        --table-name bedrock-claude-codecoach-users \
        --item \
            '{"email": {"S": "[email protected]"}, "password": {"S": "<your password>"}, "role": {"S": "admin"}}'
            
    aws dynamodb put-item \
        --table-name bedrock-claude-codecoach-users \
        --item \
            '{"email": {"S": "[email protected]"}, "password": {"S": "<your password>"}, "role": {"S": "guest"}}'
  4. install nodejs, yarn ,docker

     sudo yum install nodejs.x86_64 git docker -y
     sudo npm install yarn -g
     sudo systemctl start docker
     sudo usermod -aG docker ec2-user  #need relogin 
    
     cd ~
     python3 -m venv .venv
     . .venv/bin/activate
     pip install docker-compose
    
     git clone https://github.com/aws-samples/bedrock-claude-codecoach.git
    
     cd bedrock-claude-codecoach
     
     docker build -t codecoach .
     
     docker-compose up -d 
    
  5. install piston language runtime

    cd ~
    git clone https://github.com/engineer-man/piston.git
    cd piston/cli && yarn && cd ../
    
    #install 
    cli/index.js --piston-url http://127.0.0.1:2000  ppman install python=3.10.0
    cli/index.js --piston-url http://127.0.0.1:2000  ppman install node
    cli/index.js --piston-url http://127.0.0.1:2000  ppman install go
    cli/index.js --piston-url http://127.0.0.1:2000  ppman install php
    cli/index.js --piston-url http://127.0.0.1:2000  ppman install typescript
    
    
  6. Access CodeCoach

    http://<ec2>:3000
    

Tips

  • How to set up authentication? There are two roles for the user: the admin role uses EC2 IAM Role, and the guest can set up their own bedrock AK/SK and Cognito Identity Pool. All information is only saved locally, so if you refresh the browser, you need to set it up again.

Authors

bedrock-claude-codecoach's People

Contributors

stevensu1977 avatar dependabot[bot] avatar amazon-auto avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.