This contains everything you need to run your app locally.
View your app in AI Studio: https://ai.studio/apps/drive/1ARYaFdx2arW9joHVDoUfDS06cWXXwmXp
Prerequisites: Node.js
- Install dependencies:
npm install - Create an
.env.localfile and set any Ollama defaults you want to preload:OLLAMA_URL="https://ollama.com/api" # Leave this unset to keep the default cloud vision model OLLAMA_MODEL="qwen3-vl:235b-instruct-cloud" OLLAMA_API_KEY="your-shared-ollama-key" - Start the local Ollama proxy (new terminal):
npm run dev:proxy - Run the app:
npm run dev
- Upload standard photos (JPG/PNG) or short videos (MP4/MOV/WebM) directly from your device.
- Videos are limited to ~45 seconds and ~80MB to keep frame extraction responsive during local analysis.
- When a video is uploaded or recorded from your camera, the app samples a handful of frames in chronological order and sends them to the selected vision model, so you can reuse the same Analyze flow for both media types.
- The app calls
/api/ollama/generateand/api/ollama/test, which are implemented underfunctions/api/ollama/for deployment on Cloudflare Pages Functions. - Provide
OLLAMA_URL,OLLAMA_MODEL(optional), andOLLAMA_API_KEYas environment variables locally (.env.local) and in your Pages project settings so the proxy can reach Ollama Cloud. - Users can still supply their own URL/key via the Settings modal; the proxy simply forwards those credentials server-side to avoid browser CORS blocks.
- To store Ollama API keys securely after a successful connection test, bind a KV namespace named
KEY_STORE(or update the binding name in code) to your Pages project. The/api/keys/ollamaroute writes or deletes the key in that namespace. - Clearing keys:
curl -X DELETE https://<your-domain>/api/keys/ollama
