Open Source·
Bedrock Chat
AI chatbot built on AWS Bedrock with text generation (Titan Premier) and image generation (Titan Image v2). Published on AWS Builder.
PythonAWS BedrockStreamlitBoto3LangChainTelegram API
Bedrock Chat
An AI chatbot that uses Amazon Titan Premier for text and Titan Image Generator v2 for images, all running through AWS Bedrock. Deployed on Streamlit Cloud. Published as a tutorial on AWS Builder.
What it does
- Text generation: Conversational responses via Amazon Titan Text Premier v1:0 with configurable temperature and token limits.
- Image generation: Text-to-image with Titan Image Generator v2. 512x512, configurable CFG scale, with retry logic for throttling.
- Telegram logging: Every interaction gets logged to a Telegram bot for monitoring.
- Prompt templates: Uses LangChain's
PromptTemplate+LLMChainfor structured prompting with language selection.
How it works
The app runs on Streamlit with boto3 connecting directly to AWS Bedrock's runtime API. Text requests go through LangChain for prompt management. Image requests hit the Titan Image model with exponential backoff (5 retries, 60s delay) to handle AWS throttling.
Logging goes to both a local app.log file and a Telegram bot via the Telegram Bot API.
Stack
- Runtime: Python 3.10+
- AWS: Bedrock Runtime (
bedrock-runtime), regionus-east-1 - Models:
amazon.titan-text-premier-v1:0,amazon.titan-image-generator-v2:0 - Frontend: Streamlit with custom CSS
- Orchestration: LangChain for prompt chaining