Skip to main content

BBAWSLightsailMiniAIV1a

AI-enhanced AWS Lightsail Container Service deployment with AWS Bedrock integration.

Overview

BBAWSLightsailMiniAIV1a extends the base BBAWSLightsailMiniV1a stack to add AI capabilities through AWS Bedrock services. It provides infrastructure for AI-powered document processing, embeddings, and chat applications.

Features

  • AI-Ready Infrastructure: AWS Bedrock integration for LLM and embedding models
  • Document Processing: S3 storage with AI-optimized folder structure
  • Training Data Management: Support for URL-based content ingestion
  • Containerized Deployment: Lightsail Container Service with AI workloads
  • Scalable Storage: S3 buckets for documents, embeddings, and processed content

Installation

pip install BBAWSLightsailMiniAIV1a

Quick Start

from cdktf import App
from BBAWSLightsailMiniAIV1a import BBAWSLightsailMiniAIV1a

app = App()

# Get archetype for configuration
archetype = BBAWSLightsailMiniAIV1a.get_archetype(
    product='ai-app',
    app='smart-docs',
    tier='development',
    organization='your-org',
    region='us-east-1'
)

# Create AI-enhanced stack
ai_stack = BBAWSLightsailMiniAIV1a(
    app, "my-ai-stack",
    
    # Base configuration
    project_name=archetype.get_project_name(),
    environment=archetype.get_tier(),
    region=archetype.get_region(),
    secret_name=archetype.get_secret_name(),
    profile="default",
    
    # AI configuration
    model="anthropic.claude-3-sonnet-20240229-v1:0",
    training_urls=[
        "https://docs.aws.amazon.com/bedrock/",
        "https://your-docs.com"
    ]
)

archetype.set_stack(ai_stack)
app.synth()

Configuration

AI Models

The stack supports various AWS Bedrock models:

  • Claude Models: anthropic.claude-3-sonnet-20240229-v1:0, anthropic.claude-3-haiku-20240307-v1:0
  • Titan Models: amazon.titan-text-express-v1, amazon.titan-embed-text-v1
  • Llama Models: meta.llama2-13b-chat-v1, meta.llama2-70b-chat-v1

Training Data

Configure training URLs for document ingestion:

training_urls = [
    "https://docs.aws.amazon.com/bedrock/",
    "https://your-company.com/api-docs",
    "https://your-company.com/knowledge-base"
]

Chunking Configuration

Customize document processing:

chunk_size = 2000      # Characters per chunk
chunk_overlap = 400    # Character overlap between chunks

Architecture

The AI stack creates:

  1. S3 Buckets:

    • documents/ - Raw document storage
    • embeddings/ - Processed embeddings
    • training/ - Training data from URLs
  2. IAM Roles:

    • Bedrock access permissions
    • S3 read/write permissions
    • Container service access
  3. Lightsail Container Service:

    • AI application deployment
    • Auto-scaling configuration
    • Custom domain support

Examples

Basic Deployment

# See examples/basic_deployment.py

Advanced Configuration

# See examples/advanced_deployment.py

Environment Variables

The following environment variables are available in your container:

  • AWS_BEDROCK_MODEL: The configured Bedrock model
  • AWS_BEDROCK_EMBEDDING_MODEL: The embedding model
  • S3_DOCUMENTS_BUCKET: Documents bucket name
  • S3_EMBEDDINGS_BUCKET: Embeddings bucket name
  • CHUNK_SIZE: Document chunk size
  • CHUNK_OVERLAP: Chunk overlap size

Development

Building the Package

python prepare.py
python setup.py build

Running Tests

pytest tests/

Semantic Versioning

This package uses semantic-release for automated versioning:

semantic-release publish

Architecture Flags

Use architecture flags to customize deployment:

ArchitectureFlags = BBAWSLightsailMiniAIV1a.get_architecture_flags()

flags = [
    ArchitectureFlags.SKIP_DATABASE._value_,  # Skip database for AI-only workload
    # Add other flags as needed
]

Dependencies

  • BBAWSLightsailMiniV1a>=1.0.0 - Base Lightsail stack
  • cdktf>=0.20.0 - CDK for Terraform
  • constructs>=10.0.0 - AWS CDK constructs

License

MIT License - see LICENSE file for details.

Support

For issues and questions:

Changelog

See CHANGELOG.md for version history and changes.

Metadata

Release files for BBAWSLightsailMiniAIV1a 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for BBAWSLightsailMiniAIV1a 1.0.2
File Size Uploaded
bbawslightsailminiaiv1a-1.0.2.tar.gz 9.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for BBAWSLightsailMiniAIV1a 1.0.2
File Interpreter ABI Platform
bbawslightsailminiaiv1a-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 16.2 kB

Release files / bbawslightsailminiaiv1a-1.0.2.tar.gz

Download URL bbawslightsailminiaiv1a-1.0.2.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c68a9e0aface28999d6babe8648193f003758171c672eb3a3dc1ac09bc4ea6f8
BLAKE2b-256 checksum
How to use checksums
bf028f9cbe2a4d5073058fe61d2ec42324793eff1960821aab6987c6ea74b43b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.13.5

Release files / bbawslightsailminiaiv1a-1.0.2-py3-none-any.whl

Download URL bbawslightsailminiaiv1a-1.0.2-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d9e405828453d9e9de841d25736656e140720fa2bff9d44863e561283fa942c
BLAKE2b-256 checksum
How to use checksums
d3b9d56a3b45fd46c5feb7869759ec94d24e0aa66e0bd46db078e7b85acdfea0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.13.5

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page