OpenAI Setup
Self-Hosting Documentation Access
This section requires a password to access. Interested in self-hosting? Contact sales to learn more.
LlamaCloud supports OpenAI as the primary LLM provider for document parsing, extraction, and AI capabilities. This page guides you through configuring OpenAI integration with your self-hosted LlamaCloud deployment.
Prerequisites
Section titled “Prerequisites”- A valid OpenAI account
- OpenAI API key from OpenAI Platform
- Access and quota for the supported models:
gpt-4ogpt-4o-minigpt-4.1gpt-4.1-minigpt-4.1-nanogpt-5gpt-5-minigpt-5-nanotext-embedding-3-smalltext-embedding-3-largewhisper-1
Environment Variables
Section titled “Environment Variables”The OpenAI integration uses these environment variables:
OPENAI_API_KEY- Your OpenAI API key for LlamaParse service (required)
Note: Both variables typically contain the same API key value but are used by different services within LlamaCloud.
Configuration
Section titled “Configuration”Follow these steps to configure OpenAI integration:
Step 1: Create Kubernetes Secret
Section titled “Step 1: Create Kubernetes Secret”Create a secret with your OpenAI API key:
apiVersion: v1kind: Secretmetadata: name: openai-credentialstype: OpaquestringData: OPENAI_API_KEY: "sk-your-openai-api-key-here"Apply the secret to your cluster:
kubectl apply -f openai-secret.yamlStep 2: Configure Helm Values
Section titled “Step 2: Configure Helm Values”Reference the secret in your Helm configuration:
# External Secret (recommended)config: llms: openAi: secret: "openai-credentials"
######################################################################
# or direct configuration (not recommended for production)config: llms: openAi: apiKey: sk-your-openai-api-key-here" # Sets OPENAI_API_KEYVerification
Section titled “Verification”After configuration, verify your OpenAI integration:
-
Verify in Admin UI: Check the LlamaCloud admin interface for available OpenAI models
-
Test parsing: Upload a document to confirm OpenAI models are working
Troubleshooting
Section titled “Troubleshooting”Common Issues
Section titled “Common Issues”API Key Invalid
Section titled “API Key Invalid”Error: Incorrect API key providedSolution: Verify your API key is correct and active in the OpenAI Platform
Rate Limiting
Section titled “Rate Limiting”Error: Rate limit exceededSolution:
- Check your OpenAI usage limits
- Consider upgrading your OpenAI plan
- Implement request throttling if needed
Quota Exceeded
Section titled “Quota Exceeded”Error: You exceeded your current quotaSolution:
- Check your OpenAI billing and usage
- Add credits to your OpenAI account
- Set up billing alerts
Model Access Issues
Section titled “Model Access Issues”Error: The model 'gpt-4o' does not exist or you do not have access to itSolution:
- Verify model availability in your region
- Check if you have access to the specific model
Debug Steps
Section titled “Debug Steps”-
Test API key directly:
Terminal window curl https://api.openai.com/v1/models \-H "Authorization: Bearer $OPENAI_API_KEY" -
Check secret mounting:
Terminal window kubectl describe pod <llamacloud-pod-name> | grep -A 10 "Environment" -
Verify network connectivity: Ensure your cluster can reach
api.openai.com