mirror of
https://github.com/kvcache-ai/ktransformers.git
synced 2026-11-05 01:07:28 +00:00
[PR #1158] [MERGED] Update Function call #1572
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/ktransformers#1572
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/ktransformers/pull/1158
Author: @Creeper-MZ
Created: 4/16/2025
Status: ✅ Merged
Merged: 4/19/2025
Merged by: @qiyuxinlin
Base:
main← Head:function_call📝 Commits (6)
88f688e更改token注入逻辑,减少token注入量,防止遗忘6bc2e85Update chat.pycb266c9Fix a bug4fb19bfUpdate chat.py62c4023Fixed #1155133ba74优化提示词,解决部分Deepseek r1的兼容性📊 Changes
2 files changed (+119 additions, -116 deletions)
View changed files
📝
ktransformers/server/api/openai/endpoints/chat.py(+117 -114)📝
ktransformers/server/schemas/endpoints/chat.py(+2 -2)📄 Description
Changed the injection logic for function information. Instead of injecting all the call information into the first prompt, it now injects the function call method into the first prompt, and then injects the function related information into the latest user message, which prevents the long context function call from being forgotten and optimizes the token usage. Changed the injection language to English.
Currently, the function call only supports Deepseek-v3, llama4 is not supported yet, after checking the chat template again, I found that llama4 doesn't need to inject messages, but needs to use a different method.
Only balance serve and deepseek v3 are tested.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.