Firecrawl Self-Host LLM Setup Guide
Default LLM (no model configured): In a standard self‑hosted Firecrawl deployment, LLM-powered
features use OpenAI by default. In particular, Firecrawl’s configuration defaults MODEL_NAME to “gpt-4” and
MODEL_EMBEDDING_NAME to “text-embedding-ada-002” unless overridden 1 . (These are the defaults
used in Firecrawl’s Docker/Compose templates.) In practice, this means that if you enable LLM extraction
(e.g. the /extract endpoint) without explicitly setting another model, Firecrawl will invoke GPT-4 via the
OpenAI API.
Configuring a custom LLM: To use a different LLM (OpenAI, Azure OpenAI, Ollama, etc.) in your self-hosted
instance, set the appropriate environment variables for the API client. Key variables include:
• OPENAI_API_KEY : your OpenAI (or OpenAI-compatible) API key 2 . Firecrawl will use this key for
any OpenAI calls (chat, completion, embeddings, etc.). If this is unset, LLM features (summaries,
JSON extraction, etc.) will be disabled 2 .
• OPENAI_BASE_URL : (optional) a custom OpenAI-compatible endpoint. For example, an Azure
OpenAI or proxy URL (e.g. [Link] ) or Google’s Gemini
OpenAI-compatible API endpoint. By default Firecrawl uses OpenAI’s public API.
• MODEL_NAME : the name of the LLM model to use (e.g. gpt-4 , gpt-4o , gpt-3.5-turbo ). This
tells Firecrawl which model to request. (If you set OPENAI_BASE_URL to an alternate provider, set
this to that provider’s model name.)
• MODEL_EMBEDDING_NAME : (optional) the embedding model for any vector ops (default text-
embedding-ada-002 ).
• OLLAMA_BASE_URL : (optional) if you run an Ollama LLM server locally, set this to its API (e.g.
[Link] ), and then set MODEL_NAME to the local model name to use (e.g.
llama3.2:1b ) 3 . Firecrawl will then route LLM calls to Ollama instead of OpenAI.
These env vars can be set in your apps/api/.env file (copy .[Link] → .env per the Firecrawl
docs) or directly in your Docker Compose service definition. For Docker Compose, the Firecrawl docker-
[Link] typically pulls these from the environment. For example, a snippet from a Compose file
shows how MODEL_NAME , OPENAI_API_KEY etc. are wired into the container 3 . In practice, you would
do something like:
services:
api:
image: [Link]/firecrawl/firecrawl:latest
env_file:
- apps/api/.env # or define variables here
And in apps/api/.env set for example:
1
OPENAI_API_KEY=sk-… (your API key)
OPENAI_BASE_URL=[Link] # (or leave default)
MODEL_NAME=gpt-4
MODEL_EMBEDDING_NAME=text-embedding-ada-002
This ensures Firecrawl’s workers use your chosen LLM.
Example environment variables: Firecrawl’s documentation and community posts highlight the relevant
vars 3 2 . For instance:
• OPENAI_API_KEY – your OpenAI or OpenAI-compat key 2
• OPENAI_BASE_URL – base URL if not using OpenAI’s default endpoint
• MODEL_NAME – e.g. gpt-4 (the default) or any other model
• MODEL_EMBEDDING_NAME – e.g. text-embedding-ada-002
• OLLAMA_BASE_URL – base URL if using Ollama, plus set MODEL_NAME to your Ollama model 3
All of these can go in your .env or Docker Compose, as shown in Firecrawl’s docs: for Docker Compose,
“copy .[Link] to .env in /apps/api/ and configure as needed” 4 . (If you prefer, you can also
export them in the shell or define them in the Compose YAML under environment .)
Gemini 2.x models: As of mid-2025, Firecrawl’s self-hosted version does not have built‑in support for
Google’s Gemini models. An open GitHub issue about using Gemini for the /extract endpoint was
closed as “not planned” 5 . In other words, there’s no native “Gemini connector” in Firecrawl.
However, because Google offers an OpenAI-compatible API for Gemini, you could attempt to use it by
treating it like any other OpenAI endpoint. In theory, you would set:
• OPENAI_BASE_URL=[Link]
(Google’s Gemini OpenAI‑compat endpoint)
• OPENAI_API_KEY=<Your Google Gemini API key> (the API key from Google AI Studio)
• MODEL_NAME=gemini-2.5-pro (or gemini-2.5-flash / gemini-2.5-flash-lite )
This would point Firecrawl’s LLM calls at Gemini’s API. Caveat: Firecrawl’s code does not (yet) handle
Gemini’s special parameters (like “thinking budget” or multi-turn conversation schema) beyond what the
standard OpenAI client provides. In practice, this setup is largely untested. Community reports (issue
#1596) indicate it didn’t work out-of-box, and Firecrawl won’t pass extra Gemini parameters by default 5 .
Workarounds/alternatives: If you must use Gemini models, one possible approach is to run an
OpenAI‑compatible proxy or library that wraps Gemini, then point Firecrawl at that. For example, some
users use OpenRouter or similar to expose Gemini via the OpenAI API; you would set OPENAI_BASE_URL
to your proxy and OPENAI_API_KEY accordingly. Otherwise, a common alternative is to host an
open‑source model via Ollama or a similar LLM server and set OLLAMA_BASE_URL + MODEL_NAME as
above. (This avoids Gemini entirely.)
Summary: By default, Firecrawl will use OpenAI’s GPT-4 for LLM-based extraction/scraping when no other
model is set 1 . You override this by setting the appropriate env vars ( OPENAI_API_KEY ,
2
OPENAI_BASE_URL , MODEL_NAME , etc.) in your self‑host setup 3 2 . Google’s Gemini models are not
natively supported; attempting to use them via the OpenAI‑compatible API is nonstandard and may require
custom proxy layers.
Sources: Firecrawl’s self‑host docs and GitHub (env var examples) 3 2 , plus community deployment
guides 1 and issue discussions on Gemini support 5 . These outline the default models and
configuration variables for self-hosted Firecrawl.
1 Firecrawl Deploy Guide
[Link]
2 4 Running locally | Firecrawl
[Link]
3 [Self-Host] firecrawl ollama extract fails, appears to be because expecting a google key · Issue #1467 ·
firecrawl/firecrawl · GitHub
[Link]
5 [Self-Host] Gemini models and API when using /extract · Issue #1596 · firecrawl/firecrawl · GitHub
[Link]