jupyter-ai
jupyter-ai copied to clipboard
Add token limit attribute to providers, derive chunk size for indexing docs from this
Problem
Each LLM provider and model has limits on the input size of prompts. When a user asks questions about indexed docs with /ask
, the chunk size used to split docs in indexing affects the amount of context passed to the LLM in the prompt. Especially for smaller models that are running locally, an augmented prompt can end up exceeding the prompt size limit.
Proposed Solution
- Add token limit attribute to provider class and implement this for different providers/models.
- Use the token limit to derive the chunk size, overlap or a different chain that optimizes the indexing for that particular model.