Amazon Bedrock is a fully managed service that offers a choice of high-performing foundation models (FMs) from leading AI companies. Ollama is a command line tool that allows users to run open-source large language models (LLMs), and requires a GPU for optimal user experience.
This article details how you can deploy GPU EC2 instance to experiment with local and Bedrock cloud foundation models (FM) from your browser with Open WebUI
Prerequisites
You will need to request access to Bedrock models in your desired Region. Default is us-west-2 Region, US Oregon.
To use image generation feature, request access to Stable Diffusion 3.5 Large and Stable Image Ultra v1.0 models in us-west-2 Region and optionally Amazon Nova Canvas model in us-east-1 Region
Deploying the solution
We will use CloudFormation template to deploy the solution to GPU-powered EC2 instance.. Download the CloudFormation template (Ollama-Server.yaml), and login to your CloudFormation console to deploy it. Refer to repo site for deployment steps and options.
Accessing Web UI
When provisioned, go to your CloudFormation stack Outputs section and use WebUrl link to open a browser. Click Get Started. In the next screen and create an admin account
Create Admin Account
After which, you will be redirected to chat screen. Click on top left to select Bedrock model to use, and start interacting with the model
Bedrock chat
You can click on the Image icon to enable image generation
Image generation
To manage Ollama models, you can refer to Open Webui documentation.
Conclusion
You have learned how to deploy a user-friendly, self-hosted web frontend to interact with Amazon Bedrock and Ollama FMs.