Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chat optimization around tokens and keeping important messages in history #393

Open
wants to merge 13 commits into
base: development
Choose a base branch
from

Conversation

JuliaS92
Copy link
Collaborator

@JuliaS92 JuliaS92 commented Jan 14, 2025

This is some optimization of the chat with regards to tokens and forgetting messages.
New:

  • Function to estimate tokens
  • Constants for message keys and roles
  • Max_tokens can now be parameterized
  • Message key pinned
  • Message key in_context
  • Markdown line below chat output showing pin and token number
  • Messages are only discarded if they are not pinned

Adresses:
https://github.com/orgs/MannLabs/projects/12/views/1?filterQuery=component%3Aalphapeptstats&pane=issue&itemId=88109495
https://github.com/orgs/MannLabs/projects/12/views/1?filterQuery=component%3Aalphapeptstats&pane=issue&itemId=93499513

@JuliaS92 JuliaS92 changed the base branch from main to development January 14, 2025 10:33
@JuliaS92 JuliaS92 marked this pull request as ready for review January 14, 2025 14:14
alphastats/gui/pages/06_LLM.py Outdated Show resolved Hide resolved
alphastats/llm/llm_integration.py Show resolved Hide resolved
alphastats/gui/pages/06_LLM.py Outdated Show resolved Hide resolved
alphastats/llm/llm_integration.py Show resolved Hide resolved
alphastats/llm/llm_integration.py Outdated Show resolved Hide resolved
alphastats/llm/llm_integration.py Show resolved Hide resolved
alphastats/llm/llm_integration.py Outdated Show resolved Hide resolved
alphastats/llm/llm_integration.py Outdated Show resolved Hide resolved
alphastats/llm/llm_integration.py Outdated Show resolved Hide resolved
Copy link
Contributor

@mschwoer mschwoer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

alphastats/llm/llm_integration.py Outdated Show resolved Hide resolved
alphastats/llm/llm_integration.py Show resolved Hide resolved
alphastats/llm/llm_integration.py Show resolved Hide resolved
alphastats/gui/pages/06_LLM.py Show resolved Hide resolved
alphastats/gui/pages/06_LLM.py Outdated Show resolved Hide resolved
alphastats/llm/llm_integration.py Outdated Show resolved Hide resolved
alphastats/llm/llm_integration.py Show resolved Hide resolved
alphastats/llm/llm_integration.py Outdated Show resolved Hide resolved
alphastats/gui/pages/06_LLM.py Show resolved Hide resolved
alphastats/gui/utils/ui_helper.py Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants