[PR #4781] [MERGED] 4601 log model on response #4769

Closed
opened 2026-02-22 18:36:30 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/4781
Author: @timothycarambat
Created: 12/14/2025
Status: Merged
Merged: 12/14/2025
Merged by: @timothycarambat

Base: masterHead: 4601-log-model-on-response


📝 Commits (5)

  • 75d02b4 add model tag to chatCompletion
  • e9f1113 add modelTag model to async streaming
  • 30cf576 fix HF default arg
  • 4fd4bbe render all performance metrics as available for backward compatibility
  • 48867b0 extract metrics string to function

📊 Changes

34 files changed (+176 additions, -42 deletions)

View changed files

📝 frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/HistoricalMessage/Actions/RenderMetrics/index.jsx (+23 -3)
📝 server/utils/AiProviders/anthropic/index.js (+4 -1)
📝 server/utils/AiProviders/apipie/index.js (+5 -1)
📝 server/utils/AiProviders/azureOpenAi/index.js (+5 -1)
📝 server/utils/AiProviders/bedrock/index.js (+5 -4)
📝 server/utils/AiProviders/cohere/index.js (+4 -1)
📝 server/utils/AiProviders/cometapi/index.js (+5 -1)
📝 server/utils/AiProviders/deepseek/index.js (+4 -1)
📝 server/utils/AiProviders/dellProAiStudio/index.js (+5 -1)
📝 server/utils/AiProviders/fireworksAi/index.js (+4 -1)
📝 server/utils/AiProviders/foundry/index.js (+5 -1)
📝 server/utils/AiProviders/gemini/index.js (+4 -1)
📝 server/utils/AiProviders/genericOpenAi/index.js (+5 -2)
📝 server/utils/AiProviders/giteeai/index.js (+4 -1)
📝 server/utils/AiProviders/groq/index.js (+4 -1)
📝 server/utils/AiProviders/huggingface/index.js (+5 -1)
📝 server/utils/AiProviders/koboldCPP/index.js (+5 -1)
📝 server/utils/AiProviders/liteLLM/index.js (+5 -2)
📝 server/utils/AiProviders/lmStudio/index.js (+5 -1)
📝 server/utils/AiProviders/localAi/index.js (+5 -1)

...and 14 more files

📄 Description

Pull Request Type

  • feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • 📝 docs

Relevant Issues

resolves #4601
closes #4777

What is in this change?

  • Adds model to metrics for both chatCompletion and streamCompletion chat methods for all providers.
  • Adds timestamp to metrics for simplicity of reporting
  • Assumes default behavior for each provider, so a functional change is nothing
  • Render the model tag if present as well as message metrics timestamp

Todo: Refactor measureStream to be an object argument instead of positional. #4782

Additional Information

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Mintplex-Labs/anything-llm/pull/4781 **Author:** [@timothycarambat](https://github.com/timothycarambat) **Created:** 12/14/2025 **Status:** ✅ Merged **Merged:** 12/14/2025 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `4601-log-model-on-response` --- ### 📝 Commits (5) - [`75d02b4`](https://github.com/Mintplex-Labs/anything-llm/commit/75d02b481a890f1c65169db2766bafe88ae86d17) add model tag to chatCompletion - [`e9f1113`](https://github.com/Mintplex-Labs/anything-llm/commit/e9f1113f49f72507ced9f64541537d90e56a6645) add modelTag `model` to async streaming - [`30cf576`](https://github.com/Mintplex-Labs/anything-llm/commit/30cf5766f7a3a02e8f33fb5e6798e3f3e7f06f2e) fix HF default arg - [`4fd4bbe`](https://github.com/Mintplex-Labs/anything-llm/commit/4fd4bbe28d157573482483e84fcc7a2ac50a9fd4) render all performance metrics as available for backward compatibility - [`48867b0`](https://github.com/Mintplex-Labs/anything-llm/commit/48867b045f1578c2ae8eca9ed7f49657a3d822f9) extract metrics string to function ### 📊 Changes **34 files changed** (+176 additions, -42 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/HistoricalMessage/Actions/RenderMetrics/index.jsx` (+23 -3) 📝 `server/utils/AiProviders/anthropic/index.js` (+4 -1) 📝 `server/utils/AiProviders/apipie/index.js` (+5 -1) 📝 `server/utils/AiProviders/azureOpenAi/index.js` (+5 -1) 📝 `server/utils/AiProviders/bedrock/index.js` (+5 -4) 📝 `server/utils/AiProviders/cohere/index.js` (+4 -1) 📝 `server/utils/AiProviders/cometapi/index.js` (+5 -1) 📝 `server/utils/AiProviders/deepseek/index.js` (+4 -1) 📝 `server/utils/AiProviders/dellProAiStudio/index.js` (+5 -1) 📝 `server/utils/AiProviders/fireworksAi/index.js` (+4 -1) 📝 `server/utils/AiProviders/foundry/index.js` (+5 -1) 📝 `server/utils/AiProviders/gemini/index.js` (+4 -1) 📝 `server/utils/AiProviders/genericOpenAi/index.js` (+5 -2) 📝 `server/utils/AiProviders/giteeai/index.js` (+4 -1) 📝 `server/utils/AiProviders/groq/index.js` (+4 -1) 📝 `server/utils/AiProviders/huggingface/index.js` (+5 -1) 📝 `server/utils/AiProviders/koboldCPP/index.js` (+5 -1) 📝 `server/utils/AiProviders/liteLLM/index.js` (+5 -2) 📝 `server/utils/AiProviders/lmStudio/index.js` (+5 -1) 📝 `server/utils/AiProviders/localAi/index.js` (+5 -1) _...and 14 more files_ </details> ### 📄 Description ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [x] ✨ feat - [ ] 🐛 fix - [x] ♻️ refactor - [ ] 💄 style - [ ] 🔨 chore - [ ] 📝 docs ### Relevant Issues <!-- Use "resolves #xxx" to auto resolve on merge. Otherwise, please use "connect #xxx" --> resolves #4601 closes #4777 ### What is in this change? - Adds `model` to `metrics` for both `chatCompletion` and `streamCompletion` chat methods for all providers. - Adds `timestamp` to metrics for simplicity of reporting - Assumes default behavior for each provider, so a functional change is nothing - Render the model tag if present as well as message `metrics` timestamp Todo: Refactor `measureStream` to be an object argument instead of positional. #4782 <!-- Describe the changes in this PR that are impactful to the repo. --> ### Additional Information <!-- Add any other context about the Pull Request here that was not captured above. --> ### Developer Validations <!-- All of the applicable items should be checked. --> - [ ] I ran `yarn lint` from the root of the repo & committed changes - [ ] Relevant documentation has been updated - [ ] I have tested my code functionality - [ ] Docker build succeeds locally --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-22 18:36:30 -05:00
yindo closed this issue 2026-02-22 18:36:30 -05:00
yindo changed title from [PR #4781] 4601 log model on response to [PR #4781] [MERGED] 4601 log model on response 2026-06-05 15:20:16 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#4769