This project was created by Marcos Silva to learn about AI, Ollama, and web development.
An AI-powered personal website that answers questions about your professional experience and background. Built with Python, Flask, and Ollama AI models.
- Interactive AI assistant powered by Ollama (Gemma model)
- Custom dropdown with predefined questions
- Real-time streaming responses (SSE)
- Responsive, modern UI
- Dockerized for easy development and production deployment
- Automated Hetzner VPS provisioning with secure firewall rules and cloud-init
To personalize this website for yourself:
-
Personal Information: Edit
data/personal_info.txtwith your professional background and experience. -
Environment Variables: Set the following in your deployment:
PERSON_NAME: Your full namePERSON_ROLE: Your professional role (e.g., "DevOps Engineer")PERSON_LOCATION: Your location (e.g., "Argentina")
-
Website Content: Update
templates/index.htmlto change:- Page title and meta tags
- Sample questions in the dropdown
- Social media links and resume
- Open Graph image (replace
static/og-image.png)
-
AI Model: Customize the Modelfile and retrain the model with your data if needed.
See CONTRIBUTING.md for development setup and local run instructions.
The infrastructure is managed with Terraform (via Tofu) and includes:
- Automatic SSH key provisioning
- Secure default firewall (deny_all) attached on first boot
- Additional firewall rules (allow_rules) for HTTP, HTTPS, SSH, and ICMP
- Cloud-init configuration for user setup, security hardening, and Docker installation
export TF_VAR_hcloud_token=<YOUR_HETZNER_API_TOKEN>
export TF_VAR_ssh_publickey=<YOUR_SSH_PUBLIC_KEY>
cd infra
tofu init
tofu plan
tofu apply- On first boot, the server is attached to a restrictive
deny_allfirewall. - After provisioning, the
allow_rulesfirewall is also attached, enabling HTTP, HTTPS, SSH (22 & 2222), and ICMP (ping). - See
infra/main.tffor details.
- The server is configured via
cloud-init.yaml.tftplto:- Create a secure user
- Harden SSH
- Install Docker, fail2ban, and UFW
- Enable UFW and fail2ban
- Change SSH port to 2222
Production deployments are managed using Kamal. You need to have Kamal installed and configured for your Hetzner VPS.
export KAMAL_REGISTRY_PASSWORD=<YOUR_REGISTRY_PASSWORD>NOTE: Ensure you have configured your SSH key and Kamal.
kamal deploy -c config/deploy.ollama.ymlkamal deploy -c config/deploy.website.ymlSee the config/ directory for deployment configuration files.
- Dockerfile: Single file supports both dev and prod, switches mode based on
FLASK_ENV - compose.dev.yaml: Development setup with hot reload and file watching
- pyproject.toml: Python dependencies and project metadata
- config/deploy.ollama.yml: Kamal deployment config for Ollama service
- config/deploy.website.yml: Kamal deployment config for website service
- infra/main.tf: Terraform configuration for Hetzner VPS, firewall, and cloud-init
- infra/cloud-init.yaml.tftpl: Cloud-init template for secure server setup
- Flask - Web framework
- Ollama - AI model server (Gemma 1B)
- Docker & Docker Compose
- Gunicorn - Production WSGI server
- uv - Fast Python package manager
- Kamal - Deployment tool for any app
- Hetzner Cloud - VPS hosting
- Terraform (via OpenTofu) - Infrastructure as Code
Please see the following documents for details:
This project was built to learn about Ollama, AI models, and Flask. Most of the HTML and JavaScript was written by AI.
To contribute, fork the repo and submit a pull request!
This project is released under the MIT License.
After provisioning, you can connect to your server using the user created by cloud-init. Add the following to your ~/.ssh/config file:
Host YourVPS
HostName your-domain.com
User your-user
Port 2222
IdentityFile ~/.ssh/your-key- Replace
your-domain.comwith your server's public IP or domain if different. - Ensure your SSH public key matches the one provided to Terraform (
TF_VAR_ssh_publickey). - The SSH port is set to
2222for security (see cloud-init config). - The user has passwordless sudo and is the default login user.
Connect with:
ssh HetznerVPS