Back to writing

May 13, 2025 · essay

My Power Stack for Desktop AI is Electron, Vue, Ollama, FastAPI & Docker

Discover how Electron, Vue 3, local Ollama, FastAPI, and Docker create a formidable stack for Desktop AI Assistants, with a twist: 100% of the app code was AI-generated!

My Power Stack for Desktop AI is Electron, Vue, Ollama, FastAPI & Docker header image

The short version

LLM
This post reflects on the architectural choices and synergies that made my 'Desktop AI Assistant' possible. Remarkably, 100% of the application's code was written by Google Gemini 2.5 Pro Preview, guided by my specifications and system instructions.
Why
To share the advantages of combining Electron, Vue 3, local Ollama, a FastAPI backend, and Docker for building powerful, feature-rich desktop AI assistants when an AI handles the complete coding.
Challenge
Integrating diverse technologies smoothly when directing an AI to write all the code required precise, iterative prompting and validation. The main human challenge shifted from coding to high-level architectural design, clear task definition, and rigorous testing of AI-generated outputs.
Outcome
A robust architecture and a fully functional application ('Desktop AI Assistant') built entirely by an AI, enabling sophisticated features like local RAG, vision processing, and live transcription/summarization directly on the desktop. This showcases the paradigm shift where humans orchestrate and AI executes.
AI approach
Google Gemini 2.5 Pro Preview wrote 100% of the application code, from frontend Vue components to backend FastAPI services and Electron main process logic, following detailed system instructions and iterative task-specific prompts I provided. My role was that of an architect, prompter, and validator.
Learnings
The strengths of each technology shine when combined, even more so when an AI builds it: Electron for cross-platform UI, Vue 3 for reactivity, Ollama for local AI, FastAPI for Pythonic backend services, and Docker for dependency management. Human expertise in defining 'what' and 'why' becomes paramount when the AI handles the 'how'.

The Dawn of AI-Powered Desktop Intelligence and a Coding Revolution

The quest for powerful, private, and personalized AI tools is increasingly leading us back to the desktop. While cloud AI offers immense scale, there's a growing demand for applications that run locally, putting users in control of their data and computational resources. My "Desktop AI Assistant" is a testament to this trend, but with a significant twist: 100% of its code, from the intricate Vue 3 frontend to the complex FastAPI backend and Electron shell, was written by my AI collaborator, Google Gemini 2.5 Pro Preview. This post isn't just about a cool tech stack; it's about a new paradigm of development where human developers orchestrate AI to achieve remarkable results.

Let's explore the "Power Stack" – Electron, Vue 3, Ollama, FastAPI, and Docker – that forms the backbone of this AI-built application and how each component contributes to a truly modern Desktop AI Assistant.

The "Avengers Assemble!" - Our AI-Built Tech Stack & Their Superpowers

When I embarked on building the Desktop AI Assistant, I provided Gemini with a clear system instruction defining its role as an expert full-stack developer. My job was to specify what to build, and the AI's job was to figure out how and then write the code. The results were astounding. Here’s how the chosen technologies, all implemented by Gemini, came together:

  • Electron: The Cross-Platform Desktop Shell
    Electron was the natural choice for the application container, allowing web technologies to build a native desktop experience. Gemini seamlessly generated the main process logic, window management, and the crucial IPC (Inter-Process Communication) bridge to the renderer, all while adhering to security best practices I outlined.
  • Vue 3 (with Vite & Tailwind CSS): Crafting the User Experience
    For the frontend, Vue 3, powered by Vite's rapid development server, and styled with Tailwind CSS, provided the reactive and modern UI. Gemini produced clean, component-based Vue code using the Composition API. It structured complex features like the RAG interface into manageable components (CrawlInputForm.vue, RagQueryInput.vue, etc.) and composables (useCrawlAndRag.ts), making the AI-generated codebase surprisingly readable and maintainable.
  • Ollama: Your Personal LLM Powerhouse (Local & Private)
    A core requirement was local LLM interaction. Ollama enabled the app to use powerful models like Llama 3.x and LLaVA directly on the user's machine for chat, vision analysis, and summarization. Gemini wrote all the ollamaService.ts code to interact with Ollama's API, including model listing, streaming chat, and vision processing.
  • FastAPI: The Pythonic Backend Workhorse
    To leverage Python's rich AI/ML libraries (like Kokoro TTS and Sentence Transformers for RAG), a FastAPI backend was essential. Gemini designed and coded this backend, including:
    • Modular APIRouters for different functionalities (tts_router.py, rag_router.py).
    • The entire rag_core module, translating my high-level RAG requirements into Python services for chunking, embedding, ChromaDB interaction, and answer generation.
    • Pydantic models for robust data validation across API endpoints.
  • Docker: The Dependency Tamer and Environment Guardian
    The integration of crawl4ai (which uses Playwright) presented a classic cross-platform challenge, especially with asyncio on Windows. The solution, devised with Gemini's help after several iterations, was to Dockerize the crawler. Gemini generated the Dockerfile and the minimal FastAPI app (crawler_api.py) for this worker service, effectively isolating the problematic dependency and ensuring stable web crawling.

The Symphony: How Gemini Made These Technologies Harmonize

The true power emerges from how these components, all coded by the AI, interact. Consider the RAG workflow:

  1. The user interacts with the Vue UI (e.g., CrawlRagView.vue).
  2. An IPC call, defined in AI-generated preload scripts, travels to the Electron Main Process.
  3. Electron's crawlRagService.ts (AI-generated) makes an HTTP request to the FastAPI backend.
  4. FastAPI's rag_router.py routes to ingestion_orchestrator.py (all AI-generated).
  5. This orchestrator calls the Dockerized crawl_service_docker via HTTP.
  6. The Docker service (crawler_api.py using crawl4ai) fetches web content.
  7. The content returns to FastAPI, which then handles chunking, embedding (into ChromaDB), and storage – all logic implemented by Gemini.
  8. A similar, elegant flow handles RAG queries, with FastAPI leveraging Ollama for final answer synthesis.

This intricate dance, orchestrated by my prompts but coded entirely by Gemini, showcases a new level of AI-assisted development. My role became defining the 'what' and 'why', while the AI masterfully handled the 'how' of implementation.

AI driven Development Process

Key Advantages of This AI-Driven "Power Stack"

  • Accelerated Development: With the AI handling 100% of the coding, features were implemented at an unprecedented speed. My focus shifted to architectural integrity, prompt precision, and validation.
  • True Local-First Experience: Ollama, local vector stores (ChromaDB), and local TTS keep user data private and operations potentially offline.
  • Rich & Performant UI: Electron combined with Vue 3's reactivity and Tailwind's styling utilities, all generated by AI, resulted in a polished user interface.
  • Seamless Python Integration via FastAPI: Allowed easy access to powerful Python libraries for specialized AI tasks, with Gemini writing both the Python backend and the Electron-to-Python communication layer.
  • Robustness & Stability through Docker: Complex dependencies were perfectly managed by Docker, ensuring the crawling component worked reliably across different (conceptual) environments.
  • Focus on High-Level Design: Freed from line-by-line coding, I could concentrate on the overall system architecture, user experience flow, and the precise definition of AI capabilities.

(Brief) Challenges & Considerations in an AI-Coded World

  • Prompt Engineering is the New Coding: The quality and precision of system instructions and task-specific prompts become paramount. Ambiguity leads to AI "bugs."
  • Validation is Key: While Gemini's accuracy was exceptionally high, thorough testing and validation of AI-generated code remain crucial.
  • Understanding AI's "Reasoning": Sometimes, the AI's approach to solving a problem might be different from a human's. Understanding its logic (often evident in its well-commented code, per my instructions!) is important for debugging and extension.
  • DevOps for AI-Built Hybrid Apps: Packaging an application with Electron, a Python backend, and Docker dependencies for end-users presents unique deployment challenges (a topic for a future post!).

Conclusion: Embracing the AI Co-Developer

The "Desktop AI Assistant" stands as a powerful example of what's possible when human architects collaborate with highly capable AI code generators like Google Gemini 2.5 Pro Preview. This "Power Stack" of Electron, Vue, Ollama, FastAPI, and Docker, entirely implemented by AI under my direction, provides an incredible foundation for building sophisticated, local-first AI applications. The future of development is here, and it involves a profound partnership between human ingenuity and artificial intelligence.

It's a shift from writing every line of code to masterfully defining the problem and guiding an intelligent system to build the solution. The journey has been exhilarating, and the results speak for themselves!