jupyter-ai icon indicating copy to clipboard operation
jupyter-ai copied to clipboard

Add token limit attribute to providers, derive chunk size for indexing docs from this

Open 3coins opened this issue 1 year ago • 0 comments

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.

3coins avatar Jun 16 '23 19:06 3coins