Skip to content

Latest commit

 

History

38 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alt Text Generator

License Electron Status

A desktop app that generates descriptive alt text for images using local vision models. Drop an image in, get a description back. Everything runs on your machine — no images leave your device, no API key required for local models.


Features

  • Drag-and-drop or click-to-select images (PNG, JPG, GIF, WebP)
  • Generate descriptions using Ollama vision models: llava, llava-phi3, bakllava
  • Optionally use Hugging Face hosted models with your own token
  • Resize and optimize images before processing (canvas-based, no server round-trip)
  • Copy generated alt text with one click
  • Edit or refine descriptions inline before copying
  • Light and dark mode
  • Keyboard-accessible interface with ARIA live region announcements
  • Built-in Ollama install and model-pull flow (macOS/Linux; see Windows note below)

Dev Setup

git clone https://github.com/lukeslp/alt-text-local-ai
cd alt-text-local-ai
pnpm install

Pull Ollama models

Install Ollama, then pull at least one vision model:

ollama pull llava          # recommended — best quality
ollama pull llava-phi3     # smaller, faster
ollama pull bakllava       # alternative

Start Ollama if it isn't already running:

ollama serve

Hugging Face (optional)

If you want to use HuggingFace hosted models instead of (or in addition to) local Ollama models, create a .env.local file:

cp .env.example .env.local
# edit .env.local and set VITE_HF_TOKEN=hf_...

Start the app

pnpm start

This launches the Vite dev server on port 5173 and opens Electron pointed at it. Hot reloading works in the renderer; changes to src/main/main.js require a restart.

Requirements

  • Node.js + pnpm
  • Ollama installed and running (or a Hugging Face token for hosted models)
  • macOS 10.15+ or Windows 10+
  • 8 GB RAM recommended for local models

Windows Note

Automated Ollama install is not supported on Windows yet. When you click "Install Ollama" in the app, it opens the Ollama download page in your browser. Install it manually, then restart the app and it will detect the running server.


Building

pnpm build                     # Vite production build only
pnpm run electron:build:mac    # macOS DMG (x64 + arm64)
pnpm run electron:build:win    # Windows NSIS installer
pnpm run electron:build:linux  # AppImage + deb

Built packages land in dist_electron/.


Installing a Release

macOS

  1. Download the .dmg from the releases page
  2. Open the DMG and drag Alt Text Generator to Applications
  3. Right-click and choose Open on first launch (Gatekeeper prompt)

Windows

  1. Download the Windows installer from the releases page
  2. Run it and follow the prompts

Architecture

Three-process Electron model:

Layer File Responsibility
Main process src/main/main.js BrowserWindow, IPC handlers, Ollama lifecycle via scripts/installer.js
Preload bridge src/preload/preload.js Exposes window.electron to the renderer via contextBridge
Renderer src/App.vue + src/components/ Vue 3 + Pinia SPA, communicates with main only through the preload API

State is managed in a single Pinia store (src/store/index.js) holding the results list, selected model, feed messages, and theme settings.


Environment Variables

Variable Purpose Required
VITE_HF_TOKEN Hugging Face API token for hosted models No

Set in .env.local (gitignored). See .env.example for the template.


Privacy

All local model inference runs through Ollama on localhost:11434. No image data is sent anywhere. If you use a Hugging Face model, your images go to the HF Inference API — that's the only case where data leaves the device.


Links


Author

Luke Steuber lukesteuber.com@lukesteuber.com on Bluesky

License

MIT — see LICENSE for details.

About

Local tool for generating descriptive alt text for images using vision models

Topics

Resources

Contributing

Stars

13 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages