Skip to content
Back

AI Providers

Configure Gemini, Claude, OpenAI, DeepSeek, and Ollama as AI backends for LiveFolio folio generation.

Provider Architecture

LiveFolio uses a multi-provider factory at lib/ai/factory.ts that routes AI requests to the configured provider. Each provider implements a common interface (lib/ai/provider.interface.ts).

Two ways to supply a key

In the app (recommended). Open Settings → General and paste the key. It's stored in your browser and sent only to your local server with each chat request, so you can swap providers from the model menu without restarting anything.

As an environment variable. Server-side keys act as a fallback when no browser key is set — useful when one machine serves several people, or when you want keys to persist outside a browser profile.

Each provider below works either way.

Google Gemini (Default)

Setup — paste in Settings → General, or set in .env:

GEMINI_API_KEY=your_gemini_api_key_here

Get a key at ai.google.dev.

Models: gemini-2.5-flash, gemini-2.5-pro

Gemini is the default provider. If GEMINI_API_KEY is set and no model override is specified, requests go to Gemini.

Anthropic Claude

Setup — paste in Settings → General, or set in .env:

ANTHROPIC_API_KEY=your_anthropic_api_key_here

Get a key at console.anthropic.com.

Models: claude-sonnet-4-6, claude-opus-4-8, claude-haiku-4-5

OpenAI

Setup — paste in Settings → General, or set in .env:

OPENAI_API_KEY=your_openai_api_key_here

Get a key at platform.openai.com.

Models: gpt-4o, gpt-4o-mini

DeepSeek

Setup — paste in Settings → General, or set in .env:

DEEPSEEK_API_KEY=your_deepseek_api_key_here

Get a key at platform.deepseek.com.

Models: deepseek-chat, deepseek-reasoner

Ollama (Local)

Ollama runs models locally — no API key needed.

Setup:

# Install Ollama
brew install ollama    # macOS
# or: curl -fsSL https://ollama.com/install.sh | sh  # Linux

# Pull a model
ollama pull llama3.2
ollama pull mistral

# Start the server (runs on localhost:11434 by default)
ollama serve

Any model you've pulled with ollama pull is available in LiveFolio. Specify it by name when calling the AI endpoint.

Provider Selection

In the Editor

The editor AI panel lets you select from available providers. Only providers with configured API keys appear as options.

Via API

Specify the model in the AI endpoint request:

{
  "prompt": "Add a dark mode toggle",
  "model": "claude-sonnet-4-6"
}

The model name determines the provider:

  • gemini-* → Gemini
  • claude-* → Anthropic
  • gpt-* → OpenAI
  • deepseek-* → DeepSeek
  • Any other name → Ollama (assumed local)

Via MCP

AI generation is triggered through the editor or API — there's no direct MCP tool for AI generation. However, the create_project and update_project tools are typically used by AI agents that already have their own reasoning capabilities.

Troubleshooting

"API key not configured"

Check that the key is saved in Settings → General (it takes effect immediately), or — if you're relying on an env var — that it's set in .env and the server was restarted after adding it.

"Model not found" (Ollama)

Run ollama list to see available models. Pull the model first: ollama pull <model-name>.

"Rate limit exceeded"

Free API tiers have rate limits. Check your provider's dashboard for usage. Consider using Ollama for unlimited local inference.

"Request timed out"

AI generation can take 10-60 seconds depending on the model and prompt complexity. Large prompts with full file context may take longer. Ollama speed depends on your hardware.