Generative Ai Cdk Constructs

AWS Generative AI CDK Constructs are sample implementations of AWS CDK for common generative AI patterns.

Last verified:

Visit Generative Ai Cdk Constructs

What is Generative Ai Cdk Constructs?

AWS Generative AI CDK Constructs is an open-source extension of the AWS Cloud Development Kit (AWS CDK) that provides multi-service, well-architected patterns for quickly defining generative AI solutions in code. The library offers high-level L2 and L3 constructs that abstract complex multi-service architectures into predictable and repeatable infrastructure components, enabling developers to build generative AI applications using pattern-based definitions.

Key features include L3 constructs for SageMaker model deployment (JumpStart, Hugging Face, and Custom models), Amazon Bedrock Monitoring dashboards, Bedrock Data Automation for intelligent document processing, and Bedrock Batch Step Functions for batch inference management. L2 constructs cover Amazon Bedrock resources, Amazon OpenSearch Serverless Vector Collections, Amazon OpenSearch Vector Index, Amazon Aurora DSQL, and Amazon S3 Vectors. The library supports TypeScript, Python, Java, .Net, and Go programming languages.

This tool is designed for AWS developers, DevOps engineers, and solution architects building generative AI solutions on AWS who want to leverage well-architected best practices without manually configuring complex multi-service architectures. It is particularly useful for teams implementing RAG solutions, chatbots, foundation model deployments, and AI-powered automation workflows.

Generative Ai Cdk Constructs pricing

Pricing model: Freemium

Free and open-source under Apache-2.0 license. No paid plans or tiers. The library itself is completely free to use. Users only pay for the underlying AWS services they consume when deploying constructs (Amazon SageMaker, Amazon Bedrock, Amazon OpenSearch Serverless, AWS Lambda, AWS Step Functions, Amazon S3, Amazon Aurora DSQL, Amazon CloudWatch, AWS EventBridge, AWS IAM). Each release is built against a specific AWS CDK version (e.g., v0.0.0 built against AWS CDK v2.96.2).

Generative Ai Cdk Constructs pros

  • Open-source library with Apache-2.0 license
  • Provides high-level L2 and L3 constructs for complex AI patterns
  • Supports multiple programming languages: TypeScript, Python, Java, .Net, Go
  • Pre-built SageMaker JumpStart model deployment construct
  • Hugging Face foundation model deployment support
  • Built-in Amazon Bedrock Monitoring CloudWatch dashboard
  • Bedrock Data Automation for intelligent document processing
  • Bedrock Batch Step Functions for batch inference management
  • Amazon OpenSearch Serverless Vector Collection support
  • Amazon Aurora DSL construct for vector storage
  • Amazon S3 Vectors construct for vector data
  • Default configurations based on well-architected best practices
  • Multi-service abstractions reduce infrastructure complexity
  • Active community with 493 stars and 69 forks on GitHub
  • Official sample use cases repository available
  • Object-oriented library organization for modular architecture
  • Works with latest AWS CDK versions with upward compatibility

Generative Ai Cdk Constructs cons

  • All classes under active development, not subject to Semantic Versioning
  • Non-backward compatible changes possible in future versions
  • Amazon Bedrock L2 constructs deprecated and migrating to AWS CDK core
  • Bedrock L2 constructs in this repository will no longer receive updates
  • Requires specific AWS CDK version matching per release
  • Operational metrics collection includes anonymous deployment data
  • Legal disclaimer recommends independent testing before production use
  • No dedicated development container for local development
  • Requires manual AWS credentials configuration for development

Frequently asked questions about Generative Ai Cdk Constructs

What is AWS Generative AI CDK Constructs?

AWS Generative AI CDK Constructs is an open-source extension of the AWS Cloud Development Kit (AWS CDK) that provides multi-service, well-architected patterns for quickly defining solutions in code to create predictable and repeatable infrastructure called constructs. The goal is to help developers build generative AI solutions using pattern-based definitions for their architecture with high-level, multi-service abstractions that have default configurations based on well-architected best practices.

What programming languages are supported?

The library supports five programming languages: TypeScript (package @cdklabs/generative-ai-cdk-constructs), Python (package cdklabs.generative_ai_cdk_constructs), Java (package io.github.cdklabs.generative_ai_cdk_constructs), .Net/C# (package CdkLabs.GenerativeAICdkConstructs), and Go (package github.com/cdklabs/generative-ai-cdk-constructs-go/generativeaicdkconstructs). The library is built in TypeScript using Projen and compiled to support all client languages via JSII.

What L3 constructs are available?

The library includes six L3 constructs: SageMaker model deployment (JumpStart) for deploying foundation models from Amazon SageMaker JumpStart to endpoints, SageMaker model deployment (Hugging Face) for Hugging Face models, SageMaker model deployment (Custom) for models from S3 locations, Amazon Bedrock Monitoring CloudWatch Dashboard for monitoring Bedrock model usage, Bedrock Data Automation for intelligent document processing and multimodal data automation, and Bedrock Batch Step Functions for managing batch inference jobs in AWS Step Functions state machines.

What L2 constructs are available?

The L2 constructs include Amazon Bedrock CDK L2 Constructs (using Amazon Bedrock, Amazon OpenSearch Serverless, AWS Lambda), Amazon OpenSearch Serverless Vector Collection for creating vector collections, Amazon OpenSearch Vector Index (L1 Custom Resource) for creating vector indexes, Amazon Aurora DSQL CDK L2 Constructs, and Amazon S3 Vectors CDK L2 Constructs. Note that Amazon Bedrock L2 constructs are transitioning to the AWS CDK core repository and are deprecated in this repository.

Are Bedrock L2 constructs still maintained in this library?

No, Amazon Bedrock L2 constructs are transitioning to the AWS CDK core repository and are now deprecated in this repository. They can be found at https://github.com/aws/aws-cdk/tree/main/packages/@aws-cdk/aws-bedrock-alpha. Users should migrate to the alpha package as Bedrock L2 constructs in this repository will no longer receive updates.

How do I install the library for TypeScript?

For TypeScript, first create or use an existing CDK application with 'cdk init app --language typescript', then run 'npm install @cdklabs/generative-ai-cdk-constructs' to add the package to your package.json. Import the library using 'import * as genai from '@cdklabs/generative-ai-cdk-constructs';' in your code.

How do I install the library for Python?

For Python, create or use an existing CDK application with 'cdk init app --language python', then install the package using 'pip install cdklabs.generative_ai_cdk_constructs'. Import the library using 'import cdklabs.generative_ai_cdk_constructs' in your Python code.

What AWS services do the constructs use?

The constructs use multiple AWS services including Amazon SageMaker for model deployments, Amazon Bedrock for foundation model access, Amazon CloudWatch for monitoring dashboards, AWS Lambda for serverless compute, Amazon S3 for storage, AWS Step Functions for workflow orchestration, AWS EventBridge for event routing, AWS IAM for permissions, Amazon OpenSearch Serverless for vector collections, Amazon OpenSearch Vector Index for vector search, and Amazon Aurora DSQL for vector storage.

Are there sample use cases available?

Yes, the official samples repository at https://github.com/aws-samples/generative-ai-cdk-constructs-samples provides a collection of functional use case implementations. Additional resources include workshops, blog posts, code samples for chatbots (aws-genai-llm-chatbot, bedrock-claude-chat), RAG solutions (amazon-bedrock-rag), multimodal search apps, Knowledge Bases integration, Bedrock Agents, and Text-to-SQL solutions.

Does the library collect operational metrics?

Yes, Generative AI CDK Constructs may collect anonymous operational metrics including the region a construct is deployed, the name and version of the construct deployed, and related information. AWS uses these metrics to maintain, provide, develop, and improve the constructs and AWS services. This is disclosed in the Operational Metrics Collection section of the documentation.

Categories

Use cases

Browse all AI tools on NeedAnAI