Documentation Index
Fetch the complete documentation index at: https://mintlify.com/lumina-ai-inc/chunkr/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Chunkr supports any OpenAI-compatible API for LLM processing. You can configure multiple models with different providers, set rate limits, and specify default and fallback models.Configuration File
LLM models are configured in amodels.yaml file. Copy models.example.yaml to get started:
Model Configuration Structure
Each model in the configuration requires:Unique identifier for the model. Use this ID in POST and PATCH requests to reference the model.
The model name/identifier used by the provider (e.g.,
gpt-4o, gemini-2.0-flash-lite).The API endpoint URL for the provider’s chat completions service.
Your API key for authentication with the provider.
Mark one model as the default. This model is used when no specific model is requested.
Mark one model as the fallback. Used when
FallbackStrategy::Default is configured.Optional rate limit in requests per minute for this model.
You must configure exactly one default model and one fallback model (they can be the same model).
Provider Examples
- OpenAI
- Google AI Studio
- OpenRouter
- Self-Hosted
models.yaml
Rate limits help prevent API quota exhaustion. OpenAI has different rate limits based on your tier.
Complete Example
Here’s a completemodels.yaml with multiple providers:
models.yaml
Using Models in Requests
Specifying a Model
Reference your configured model by itsid in the llm_processing configuration:
Default Model
If you don’t specify amodel_id, the model marked with default: true is used automatically:
Fallback Strategy
Configure how Chunkr handles LLM failures:None: No fallback, task fails on LLM errorDefault: Use the model marked withfallback: trueModel("model-id"): Use a specific model as fallback
Rate Limiting
Rate limits prevent exceeding provider quotas:Best Practices
-
Use different models for different purposes
- Fast model (e.g., GPT-4o-mini, Gemini Flash) for simple segments
- High-quality model (e.g., GPT-4o) for complex tables and formulas
-
Configure appropriate rate limits
- Check your provider’s rate limits
- Set conservative limits to avoid throttling
-
Always configure a fallback
- Ensures processing continues if primary model fails
- Use a reliable, fast model as fallback
-
Test your configuration
Troubleshooting
Model Not Found
If you get a “model not found” error:- Verify the model
idexists in yourmodels.yaml - Check that
LLM__MODELS_PATHpoints to the correct file - Restart the Chunkr service after updating
models.yaml
Authentication Errors
- Verify your API key is correct and not expired
- Check that the API key has the necessary permissions
- For self-hosted models, verify the endpoint is accessible
Rate Limit Errors
- Lower the
rate-limitvalue in your configuration - Upgrade your provider tier for higher limits
- Configure a fallback model with higher limits