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).

Google Gemini (Default)

Setup:

# .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:

# .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:

# .env
OPENAI_API_KEY=your_openai_api_key_here

Get a key at platform.openai.com.

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

DeepSeek

Setup:

# .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 Studio

The studio 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 studio 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 corresponding env var is 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.