genai-factory

genai-factory

A collection of end-to-end blueprints to deploy generative AI infrastructures in GCP, following security best-practices.

Stars: 69

Visit
 screenshot

GenAI Factory is a collection of end-to-end blueprints to deploy generative AI infrastructures in Google Cloud Platform (GCP), following security best practices. It embraces Infrastructure as Code (IaC) best practices, implements infrastructure in Terraform, and follows the least-privilege principle. The tool is compatible with Cloud Foundation Fabric FAST project-factory and application templates, allowing users to deploy various AI applications and systems on GCP.

README:

GenAI Factory

Linting Tests

Genai-factory is a collection of end-to-end blueprints to deploy generative AI infrastructures in GCP, following security best-practices.

Cloud Foundation Fabric Compatibility

Works with Cloud Foundation Fabric from v42.1.0 or daily-2025.08.13. Checkout previous genai-factory releases if you are running older versions of Fabric.

Factories

These sample infrastructure deployments and applications can be used to be further extended and to ship your own application code.

Quickstart

The quickstart assumes you have permissions to create and manage projects and link to the billing account.

# Enter your preferred factory, for example cloud-run-single
cd cloud-run-single

# Create the project, service accounts, and grant permissions.
cd 0-projects
cp terraform.tfvars.sample terraform.tfvars # Replace prefix, billing account and parent.
terraform init
terraform apply

cd ..

# Deploy the platform services.
cd 1-apps
cp terraform.tfvars.sample terraform.tfvars # Customize.
terraform init
terraform apply

# Deploy the application and follow the commands in the output.

Factories Structure

Each factory contains two stages:

0-projects

It creates projects and service accounts, enables APIs, and grants IAM roles using Fabric FAST project application templates.

Running this stage is optional. If you can create projects, use it. Alternatively, give the yaml project template to your platform team. They can use it with their FAST project factory or easily derive the requirements and implement them with their own mechanism.

The stage also creates components in the same project to allow the 1-apps stage to run. This includes Terraform service accounts, roles, and a state bucket. Finally, the stage writes providers.tf and terraform.auto.tfvars files in the 1-apps folder.

1-apps

It deploys the core platform resources within the project and the AI application on top.

If you created the project outside genai-factory (instead of using 0-projects), make sure to provide the 1-apps stage with the APIs, service accounts and roles it requires. Projects and service account details are passed to 1-apps via a terraform.auto.tfvars file, automatically created when 0-projects runs.

Networking Configuration

By default, 1-apps stages create VPCs and other networking components if these are needed by the factory infrastructure and applications. These include VPCs, subnets, routes, DNS zones, Private Google Access (PGA), and more.

You also have the option to leverage existing VPCs. In this case, it will be your responsibility to create everything needed by the application to work.

To do so, make sure your terraform.tfvars in 1-apps contains this configuration:

networking_config = {
  create    = false
  vpc_id    = "your-vpc-id"
  subnet = {
    name = "your-subnet-id"
  }
}

Credits

Thanks to the Cloud Foundation Fabric community for ideas, input, and useful tools.

Contribute

Contributions are welcome! You can follow the guidelines in the Contributing section.

For Tasks:

Click tags to check more tools for each tasks

For Jobs:

Alternative AI tools for genai-factory

Similar Open Source Tools

For similar tasks

For similar jobs