Cloudflare Workers AI
Setup: AI Gateway Setup | Workers AI Models
Notes:
- OpenAI Compatible: Uses the OpenAI compatible endpoint specification (documentation)
- Known Issue:
@cf/openai/gpt-oss-*
models may not work due to spec incompatibility - Environment Variables Required:
CF_API_TOKEN
: Your Cloudflare API tokenCF_ACCOUNT_ID
: Your Cloudflare account IDCF_GATEWAY_ID
: Your AI Gateway ID- Note: these environment variables can be customized/renamed as needed.
librechat.yaml
- name: "Cloudflare Workers AI"
apiKey: "${CF_API_TOKEN}"
baseURL: "https://gateway.ai.cloudflare.com/v1/${CF_ACCOUNT_ID}/${CF_GATEWAY_ID}/workers-ai/v1"
models:
default: [
"@cf/google/gemma-3-12b-it",
"@cf/meta/llama-4-scout-17b-16e-instruct",
"@cf/qwen/qwq-32b",
"@cf/qwen/qwen2.5-coder-32b-instruct",
"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
"@cf/openai/gpt-oss-120b"
]
fetch: false
titleConvo: true
titleModel: "@cf/google/gemma-3-12b-it"
modelDisplayLabel: "Cloudflare AI"