Skip to content

Introduction to Angular Language Kit

Angular Language Kit is a privacy-first AI chat application built with Angular. It leverages Chromeโ€™s Built-in AI (Gemini Nano) to run Large Language Models directly in your browser. This means your data is processed locallyโ€”offlineโ€”without ever being sent to a cloud server.

๐Ÿš€ Features

  • ๐Ÿ”’ Local Inference: Uses the Chrome Prompt API to generate responses entirely on-device.
  • ๐Ÿ“‚ Persistent History: Chat sessions are saved locally using IndexedDB, keeping your conversations private and persistent across reloads.
  • ๐Ÿง  Auto-Summarization: Uses the Chrome Summarizer API to automatically generate concise titles for your chat sessions.
  • โšก Real-time Streaming: Implements full streaming responses for a snappy, conversational experience.
  • ๐ŸŽจ Modern UI: Built with Angular Material and Tailwind CSS for a responsive, clean interface.
  • Token Tracking: Real-time visualization of token usage and context window limits.

๐Ÿ›  Architecture

The project is structured around strongly-typed services:

  • PromptApiService: Manages the AI session lifecycle, streaming responses, and tracks token quota/usage (inputUsage, inputQuota).
  • SummarizerService: Detects capabilities and generates headlines for new chats using the window.ai.summarizer API.
  • StorageService: Handles all IndexedDB operations to store chat metadata and message history locally.