Skip to content

AWS Bedrock Presentation Generator

Overview

100% AWS-compliant AI presentation generation system that replaces Gamma AI with AWS Bedrock services.

Status:AWS SaaS Policy Compliant Replaces: Gamma AI (non-compliant external service) Date: 2025-11-21


Architecture

Components

User Request
BedrockPresentationService (Main Orchestrator)
    ├──→ BedrockContentGenerator (Claude Sonnet 4.5)
    │    └──→ Generates presentation structure, text, speaker notes
    ├──→ BedrockImageGenerator (Stable Diffusion SDXL)
    │    └──→ Generates slide images from AI prompts
    └──→ PresentationAssembler (PhpPresentation)
         └──→ Assembles PPTX file with content + images
              └──→ Stores on AWS S3

AWS Services Used

Service Purpose Model/Config
AWS Bedrock Runtime LLM inference Claude Sonnet 4.5 (anthropic.claude-sonnet-4-5-20250929-v1:0)
AWS Bedrock Runtime Image generation Stable Diffusion SDXL (stability.stable-diffusion-xl-v1)
AWS S3 File storage Presentation files, images
AWS Secrets Manager Credentials AWS access keys (optional)

Compliance: ✅ All services run on AWS infrastructure


Implementation Details

1. Content Generation (BedrockContentGenerator)

Model: Claude Sonnet 4.5 Purpose: Generate presentation outline, slide content, bullet points

Process: 1. User provides topic, number of slides, language, tone, audience 2. Claude generates structured JSON response:

{
  "title": "Presentation Title",
  "subtitle": "Optional subtitle",
  "slides": [
    {
      "slideNumber": 1,
      "heading": "Slide Title",
      "bulletPoints": ["Point 1", "Point 2"],
      "imagePrompt": "AI image generation prompt",
      "speakerNotes": "Presenter notes"
    }
  ]
}
3. Content is validated and stored

Cost per presentation: ~$0.003 (2,000 tokens @ $0.0000015/token)


2. Image Generation (BedrockImageGenerator)

Model: Stable Diffusion SDXL Purpose: Generate professional images for each slide

Process: 1. Takes imagePrompt from each slide 2. Enhances prompt with quality modifiers: - "professional, high quality, detailed, 4k, sharp focus" - Style-specific enhancements (photographic, corporate, cinematic) 3. Generates 1024x1024 images 4. Stores images on AWS S3 with public access 5. Returns S3 URLs for embedding

Supported Styles: - photographic - Photorealistic images - corporate - Professional business style - digital-art - Digital artwork - illustration - Vector illustration style - cinematic - Dramatic movie poster style

Cost per image: ~$0.05 Cost for 10-slide presentation: ~$0.50 (10 images)

Total generation cost: ~$0.50 per presentation


3. Presentation Assembly (PresentationAssembler)

Library: PhpOffice/PhpPresentation Output Format: PowerPoint 2007+ (.pptx)

Features: - ✅ Title slide with heading + subtitle - ✅ Content slides with heading, bullet points, images - ✅ Speaker notes for each slide - ✅ Customizable slide dimensions (16:9, 4:3) - ✅ Professional formatting and styling - ⚠️ PDF export (requires LibreOffice - future enhancement)

Fallback: HTML presentation if PhpPresentation not available

Storage: AWS S3 (compliant)


Installation & Setup

1. Install Dependencies

composer require phpoffice/phppresentation
composer require aws/aws-sdk-php

2. Environment Configuration

Add to .env:

# AWS Bedrock Configuration
AWS_ACCESS_KEY_ID=your_access_key
AWS_SECRET_ACCESS_KEY=your_secret_key
AWS_DEFAULT_REGION=us-east-1

# AWS S3 Storage
AWS_BUCKET=your-bucket-name
AWS_URL=https://your-bucket.s3.amazonaws.com

# Filesystem default (use S3 for compliance)
FILESYSTEM_DISK=s3

3. Update AiPresentation Controller

Replace GammaService with BedrockPresentationService:

// OLD (Non-compliant)
use App\Extensions\AiPresentation\System\Services\GammaService;
$service = new GammaService();

// NEW (AWS-compliant)
use App\Extensions\AiPresentation\System\Services\BedrockPresentationService;
$service = new BedrockPresentationService();

Files to update: - app/Extensions/AiPresentation/System/Http/Controllers/AiPresentationController.php - app/Extensions/AiPresentation/System/Http/Controllers/GammaAiSettingsController.php (remove or repurpose)

4. Database Migration (if needed)

The ai_presentations table should already exist. If not:

Schema::table('ai_presentations', function (Blueprint $table) {
    $table->json('content_data')->nullable();
    $table->json('images_data')->nullable();
    $table->string('pptx_url')->nullable();
    $table->string('pdf_url')->nullable();
});

API Usage

Generate Presentation

Request:

$result = $bedrockService->generatePresentation([
    'description' => 'Benefits of Cloud Computing',
    'presentation_count' => 10,
    'language' => 'en',
    'text_length' => 'medium',
    'textOptions' => [
        'tone' => 'professional',
        'audience' => 'technical managers',
    ],
    'imageOptions' => [
        'style' => 'corporate',
    ],
    'exportAs' => 'pptx', // or 'pdf'
]);

Response:

object(stdClass) {
    msg: "Presentation generated successfully"
    type: "success"
    data: {
        generationId: "bedrock_abc123_1234567890"
        status: "completed"
        pptxUrl: "https://bucket.s3.amazonaws.com/media/presentations/..."
        pdfUrl: null
    }
}

Check Status

$status = $bedrockService->getGenerationStatus($generationId);

Comparison: Gamma AI vs AWS Bedrock

Feature Gamma AI (Old) AWS Bedrock (New) Status
Compliance ❌ External API ✅ AWS-hosted
Content Generation Gamma AI Claude Sonnet 4.5 ✅ Better quality
Image Generation Gamma AI SDXL Bedrock ✅ Same quality
Cost per presentation ~$0.05 ~$0.50 ⚠️ Higher cost
Customization ❌ Limited ✅ Full control
Export Formats PDF, PPTX PPTX (PDF coming) ⚠️
Speed ~30-60 seconds ~45-90 seconds ⚠️ Slightly slower

Cost Analysis

Gamma AI (Non-compliant): - $0.01-0.05 per presentation - ❌ Risk losing AWS benefits - ❌ Risk losing PPA drawdown - ❌ Badge removal by Jan 21, 2026

AWS Bedrock (Compliant): - $0.50 per presentation - ✅ 100% compliant - ✅ Retain all AWS benefits - ✅ Keep "Deployed on AWS" badge

ROI: The extra $0.45/presentation cost is worth it to maintain AWS partnership benefits.


Testing

Test Generation

php artisan tinker

$service = new \App\Extensions\AiPresentation\System\Services\BedrockPresentationService();

$result = $service->generatePresentation([
    'description' => 'Introduction to AWS Bedrock',
    'presentation_count' => 5,
    'language' => 'en',
    'text_length' => 'medium',
    'exportAs' => 'pptx',
]);

dump($result);

Verify S3 Storage

aws s3 ls s3://your-bucket/media/presentations/ --recursive

Migration Guide

From Gamma AI to AWS Bedrock

Step 1: Install dependencies

composer require phpoffice/phppresentation aws/aws-sdk-php

Step 2: Update controller imports

// Change this
use App\Extensions\AiPresentation\System\Services\GammaService;

// To this
use App\Extensions\AiPresentation\System\Services\BedrockPresentationService;

Step 3: Update service instantiation

// Change this
$service = new GammaService();

// To this
$service = new BedrockPresentationService();

Step 4: No API changes needed - interface is compatible!

Step 5: Test thoroughly

Step 6: Remove Gamma AI references

rm -f app/Extensions/AiPresentation/System/Services/GammaService.php
rm -f app/Extensions/AiPresentation/System/Services/GammaCreditPredictor.php
rm -f app/Extensions/AiPresentation/System/Http/Controllers/GammaAiSettingsController.php


Future Enhancements

Phase 2 (Optional)

  1. PDF Export
  2. Integrate LibreOffice headless for PPTX → PDF conversion
  3. Or use AWS Lambda with LibreOffice layer

  4. Template Support

  5. Pre-designed PowerPoint templates
  6. Corporate branding integration

  7. Fine-Tuning

  8. Fine-tune Claude on company-specific presentation style
  9. Custom prompt engineering for industry verticals

  10. Batch Generation

  11. Generate multiple presentations in parallel
  12. Queue system with AWS SQS

  13. Video Export

  14. Convert presentations to video
  15. Use AWS MediaConvert for video processing

Troubleshooting

Error: "Class PhpPresentation not found"

Solution: Install the library

composer require phpoffice/phppresentation

Error: "AWS credentials not found"

Solution: Check .env file

AWS_ACCESS_KEY_ID=your_key
AWS_SECRET_ACCESS_KEY=your_secret
AWS_DEFAULT_REGION=us-east-1

Error: "Failed to save to S3"

Solution: Verify S3 bucket permissions

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": ["s3:PutObject", "s3:GetObject"],
      "Resource": "arn:aws:s3:::your-bucket/*"
    }
  ]
}

Error: "Bedrock InvokeModel failed"

Solution: Enable Bedrock models in AWS Console - Go to AWS Bedrock console - Request access to Claude Sonnet 4.5 - Request access to Stable Diffusion SDXL


Compliance Checklist

  • ✅ Content generation on AWS (Bedrock Claude)
  • ✅ Image generation on AWS (Bedrock SDXL)
  • ✅ Storage on AWS (S3)
  • ✅ No external API calls to third parties
  • ✅ All application data stays on AWS infrastructure
  • ✅ Meets AWS SaaS Policy requirements

Compliance Status:100% AWS-Compliant


Support

Issues: https://github.com/vell-io/vell-main/issues AWS Bedrock Docs: https://docs.aws.amazon.com/bedrock/ PhpPresentation Docs: https://phpoffice.github.io/PhpPresentation/


Last Updated: 2025-11-21 Author: Claude Code (Compliance Automation) Version: 1.0.0