d48318ad6be922c8781fe53cf3c64bb15f7aaa26
AI Chat OIDC + Ollama Cloud
This repository includes:
backend/— FastAPI service validating OIDC JWTs and proxying chat to Ollama Cloud with SSE streamingfrontend/— React + Vite + TypeScript UI performing OIDC Authorization Code Flow with PKCEdocker-compose.yml— brings up backend, frontend, and optional Keycloak (dev-only)
Prerequisites
- Docker >= 24.0
- Docker Compose >= 2.0
- An Ollama Cloud API key
- An OIDC issuer URL, client ID, and client secret
Setup
- Copy
.env.exampleto.envand set values. - In the frontend, set
VITE_OIDC_REDIRECT_URItohttp://localhost:5173or your UI URL. - If using the local Keycloak dev service, enable the
devprofile:
docker compose --profile dev up --build
- If you only want backend/frontend with an external OIDC provider:
docker compose up --build
API
GET /health— health checkGET /auth/config— OIDC discovery endpoints for the frontendPOST /auth/callback— exchanges OIDC code for tokensPOST /chat— protected chat endpoint streaming SSE from Ollama Cloud
Notes
- The backend requires
OLLAMA_API_KEYin environment. - The frontend stores the access token in
localStoragefor simplicity. - OpenAPI docs are available at
http://localhost:8000/docs.
Languages
TypeScript
51.1%
Python
46%
Dockerfile
1.9%
HTML
1%