multi-provider llm abstraction with provider-agnostic inference
Vane implements a unified provider abstraction layer (src/lib/models/providers) that normalizes API calls across 8+ LLM providers including OpenAI, Anthropic, Google Gemini, Groq, Ollama, LMStudio, and Lemonade. The system uses a provider factory pattern to instantiate the correct client based on configuration, handling provider-specific request/response formatting, streaming protocols, and error handling transparently. This allows swapping providers via environment variables without code changes, enabling cost optimization and fallback strategies.
Unique: Uses a factory pattern with provider-specific adapters (src/lib/models/providers) to normalize streaming, error handling, and request formatting across fundamentally different APIs (OpenAI's chat completions vs Ollama's local inference), rather than wrapping a single SDK
vs alternatives: More flexible than Langchain's provider support because it handles local LLMs (Ollama, LMStudio) with the same abstraction as cloud providers, enabling true privacy-first deployments without external API calls
privacy-preserving web search via searxng meta-search integration
Vane integrates SearXNG (src/lib/searxng.ts), a privacy-respecting meta-search engine, to perform web queries without sending user data to Google, Bing, or other commercial search engines. The integration abstracts SearXNG's HTTP API, handling query formatting, result parsing, and deduplication of results across multiple search backends that SearXNG aggregates. Results are streamed back to the agent with source attribution, enabling the LLM to synthesize answers from multiple sources without exposing user queries to surveillance-based search providers.
Unique: Integrates SearXNG as a privacy layer between user queries and search backends, ensuring no query data reaches commercial search engines; combines this with LLM synthesis to produce cited answers rather than ranked links
vs alternatives: Provides true privacy compared to Perplexity or traditional search engines because SearXNG aggregates results without logging queries, and Vane can run entirely on-premises with local LLMs
real-time streaming responses via server-sent events
Vane streams research results and answer synthesis in real-time to the client using Server-Sent Events (SSE) rather than waiting for complete answer generation. The backend emits events for each research step (search initiated, results retrieved, synthesis started, answer chunk generated), allowing the client to display progress and partial results immediately. The useChat hook (src/app/c/[chatId]/hooks/useChat.ts) handles SSE event parsing and state updates, enabling smooth real-time UI updates without polling or WebSocket complexity.
Unique: Uses SSE for streaming research progress and partial answers, enabling real-time UI updates without WebSocket complexity; events are structured to allow client-side progress visualization
vs alternatives: More resilient than WebSocket for streaming because SSE automatically reconnects on network interruption; simpler than polling because events are pushed rather than pulled
multi-turn conversation context with follow-up question support
Vane maintains multi-turn conversation context by storing previous messages and citations in SQLite, passing conversation history to the LLM for each new query. The research agent uses conversation context to understand follow-up questions (e.g., 'Tell me more about X' refers to previous answer), refine searches based on prior results, and avoid redundant research. The system tracks which sources were already cited to avoid repetition and enables the LLM to make context-aware decisions about which new sources to research.
Unique: Passes full conversation history to the research agent, enabling context-aware search refinement and follow-up question understanding without explicit intent classification
vs alternatives: More natural than intent-based follow-up handling because the LLM can infer context from conversation history; more efficient than re-searching because prior results are available in context
configurable model provider selection with environment-based switching
Vane allows switching between LLM providers via environment variables (e.g., PROVIDER=openai, PROVIDER=ollama) without code changes. The configuration system (src/lib/models/providers) reads provider settings from environment variables, instantiates the appropriate provider client, and passes it to the research agent. This enables different deployment configurations: development with local Ollama, staging with Anthropic, production with OpenAI, all from the same codebase. Provider-specific settings (API keys, model names, temperature) are also environment-configurable.
Unique: Encodes provider selection in environment variables with a factory pattern that instantiates the correct provider client at startup, enabling zero-code provider switching across deployments
vs alternatives: Simpler than Langchain's provider configuration because it avoids runtime provider selection overhead; more flexible than hardcoded providers because any provider can be selected via environment
research agent with multi-source document synthesis
Vane implements a research agent (src/lib/agents/search/researcher) that decomposes user queries into sub-research tasks, executes parallel searches across multiple source types (web, academic papers, discussions, domain-specific databases), and synthesizes results into a coherent answer with citations. The agent uses chain-of-thought reasoning to determine which sources are relevant, iteratively refines searches based on intermediate results, and tracks source provenance throughout the synthesis process. Results are streamed via Server-Sent Events, allowing real-time progress updates to the client.
Unique: Implements a stateful research agent that tracks source provenance through the synthesis pipeline, enabling transparent citation and iterative refinement based on intermediate results, rather than one-shot search-and-summarize
vs alternatives: More transparent than Perplexity because source tracking is built into the agent logic, not post-hoc; supports local LLMs and SearXNG for full privacy, unlike cloud-based competitors
search mode optimization with configurable depth-vs-speed tradeoffs
Vane provides three search modes (Speed, Balanced, Quality) implemented in src/lib/agents/search/index.ts that adjust the research agent's behavior: Speed mode performs single-pass searches with minimal source diversity, Balanced mode uses 2-3 parallel searches across different source types, and Quality mode executes iterative refinement with 5+ searches and cross-source validation. Each mode configures the number of parallel searches, result filtering thresholds, and LLM reasoning depth, allowing users to trade latency for answer comprehensiveness without code changes.
Unique: Encodes latency-vs-quality tradeoffs as discrete search modes with explicit configuration of parallel search counts and refinement iterations, rather than exposing raw parameters
vs alternatives: More transparent than Perplexity's implicit quality tuning because users explicitly select their latency budget; enables cost optimization for cost-sensitive deployments
contextual widget generation for structured data queries
Vane includes a widget system (src/lib/agents/search/widgets) that detects query intent and generates contextual UI cards for structured data types: weather widgets display current conditions and forecasts, stock widgets show price and trend data, calculator widgets handle mathematical expressions, and domain-specific widgets (sports scores, flight info) render relevant data. The system uses LLM-based intent detection to determine widget type, queries specialized APIs or SearXNG for data, and returns structured JSON that the frontend renders as rich UI components rather than plain text.
Unique: Uses LLM-based intent detection to trigger widget generation, enabling dynamic widget selection without hardcoded query patterns; widgets return structured JSON that decouples backend data logic from frontend rendering
vs alternatives: More extensible than Google's answer cards because widget types can be added via configuration; more privacy-preserving than Perplexity because widget data can come from local APIs or SearXNG
+5 more capabilities