JSPM

  • Created
  • Published
  • Downloads 72
  • Score
    100M100P100Q68418F
  • License Apache-2.0

Builds a secure, log-in protected LLM playground that can be customized to your data. Use this blueprint to build and deploy your own chatbot.

Package Exports

  • @amazon-codecatalyst/blueprints.gen-ai-chatbot
  • @amazon-codecatalyst/blueprints.gen-ai-chatbot/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@amazon-codecatalyst/blueprints.gen-ai-chatbot) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

LLM Chatbot Playground

This blueprint generates a sample chatbot using the Anthropic company's LLM Claude 2, one of the foundational models provided by Amazon Bedrock for generative AI.

Basic Conversation

Bot Personalization

Add your own instruction and give external knowledge as URL or files (a.k.a RAG). The bot can be shared among application users.

πŸ“š Supported Languages

  • English πŸ’¬
  • ζ—₯本θͺž πŸ’¬ (ドキγƒ₯γƒ‘γƒ³γƒˆγ―γ“γ‘γ‚‰)
  • ν•œκ΅­μ–΄ πŸ’¬
  • δΈ­ζ–‡ πŸ’¬

πŸš€ Super-easy Deployment

  • On us-east-1, open Bedrock Model access > Manage model access > Check Anthropic / Claude, Anthropic / Claude Instant and Cohere / Embed Multilingual then Save changes.
Screenshot

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.

Connections and permissions

This blueprint supports the Amazon CodeCatalyst Development Role, which can be created from the AWS console Codecatalyst management application. When clicking "add IAM role", the first option is to create a CodeCatalyst development role. This role can be used across multiple blueprints.

The other option is creating a blueprint specific IAM role, which can be added to the Amazon CodeCatalyst space by selecting "Add an existing IAM role" from the add IAM role options. The IAM role needs to contain the CodeCatalyst trust policy, as well as the following permissions:

{
  "Version": "2012-10-17",
  "Statement": [
      {
          "Effect": "Allow",
          "Action": [
            "iam:DeleteRole",
            "iam:GetRole",
            "iam:TagRole",
            "iam:CreateRole",
            "iam:AttachRolePolicy",
            "iam:DetachRolePolicy",
            "iam:DeleteRolePolicy",
            "cloudformation:*",
            "lambda:*",
            "apigateway:*",
            "ecr:*",
            "ssm:PutParameter",
            "ssm:DeleteParameter",
            "iam:PutRolePolicy",
            "s3:*",
            "ssm:GetParameter",
            "ssm:GetParameters"
          ],
          "Resource": "*"
      },
      {
          "Effect": "Allow",
          "Action": [
              "sts:AssumeRole"
          ],
          "Resource": [
              "arn:aws:iam::*:role/cdk-*"
          ]
      }
  ]
}

The IAM roles also require the Amazon CodeCatalyst service principals codecatalyst.amazonaws.com and codecatalyst-runner.amazonaws.com.

Required IAM role trust policy:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "",
            "Effect": "Allow",
            "Principal": {
                "Service": [
                    "codecatalyst.amazonaws.com",
                    "codecatalyst-runner.amazonaws.com"
                ]
            },
            "Action": "sts:AssumeRole"
        }
    ]
}

Features and Roadmap

Basic chat features

  • Authentication (Sign-up, Sign-in)
  • Creation, storage, and deletion of conversations
  • Copying of chatbot replies
  • Automatic subject suggestion for conversations
  • Syntax highlighting for code
  • Rendering of Markdown
  • Streaming Response
  • IP address restriction
  • Edit message & re-send
  • I18n
  • Model switch (Claude Instant / Claude)

Customized bot features

  • Customized bot creation
  • Customized bot sharing

RAG features

  • Web (html)
  • Text data (txt, csv, markdown and etc)
  • PDF
  • Microsoft office files (pptx, docx, xlsx)
  • Youtube transcript

Admin features

  • Admin console to analyze user usage

RAG (Retrieval Augmented Generation)

See here.

Authors

License

This library is licensed under the MIT-0 License. See the LICENSE file.


When you create or update a project using a blueprint, CodeCatalyst may generate resources such as source repository, sample source code, CI/CD workflows, build and test reports, secrets, integrated issue tracking tools, etc. You should review the generated artifacts/project before deploying to a production or publicly accessible environment. You are responsible for all activities in your production and publicly accessible environments.