Cost Control
- Caching: Set Caching (e.g.
aiCacheLifetime= 2592000 = 30 days) to avoid repeated API calls for the same search term. - Retrieval:
aiTopKandaiMaxCharsPerChunklimit the context size and thus input tokens.aiMaxTokensResponselimits the answer length. - Embeddings: One embedding call per search; at index time, one call per index entry.
Use affordable embedding models (e.g. Mistral
mistral-embed).