fix: separate LLM and embedding token limits#3
Open
lucifery1234-create wants to merge 1 commit into
Open
Conversation
Author
|
This PR addresses the Algora bounty listed as daytonaio/devcontainer-generator#12: Handle Different Context Lengths Between LLM and Embedding Models ($20) The original linked GitHub repository, daytonaio/devcontainer-generator, currently returns 404. This PR targets the public repository currently available for the same codebase: nibzard/devcontainer-generator. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
/claim #12
Summary
This PR separates context-window handling for chat/LLM generation from embedding generation.
Previously, the app had a hard-coded chat context truncation path and a separate embedding truncation path, but model-specific tokenization and max token settings were not consistently handled. That makes it easy for repositories with larger contexts to be truncated against the wrong model window, especially when using different chat and embedding models.
Changes
LLM_MODEL_MAX_TOKENSfor devcontainer generation context truncation.EMBEDDING_MODEL_MAX_TOKENSseparate for embedding requests.cl100k_basewhentiktokendoes not know a configured model name.LLM_MODEL_MAX_TOKENSin.env.example.Tests
Ran:
Result:
Repository note
Algora still links the bounty to
daytonaio/devcontainer-generator, but that GitHub repository currently returns 404 through the live GitHub API. This PR targets the public repository currently available for the codebase:nibzard/devcontainer-generator.