Add request/response logging hook to native model client
维护者通常 1 天内回复
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 冷清
- 技术栈
- python
- 领域
- ai, api, backend-api-design
调研方向
从 packages/data-designer-engine/src/data_designer/engine/models/clients/ 开始,阅读 ThrottledModelClient、clients/retry.py 和 clients/types.py。在选择 hook 设计之前,比较现有的 wrapper 和 transport 组合模式。当消费者能够观察到等效的 request 和 response 详细信息(包括 prompt、model、kwargs、response body 和 token usage),并且所选接口具有 coverage 时,该 issue 即完成。
由索引模型根据 Issue 内容生成。
描述
Priority Level
Medium (Nice to have)
Is your feature request related to a problem? Please describe.
With the migration from litellm to the native model client in DD 0.5.5, there's no built-in way to capture full HTTP request/response payloads for LLM API calls. Previously, litellm's callback system allowed registering custom loggers that could observe every request and response. This was useful for debugging prompt issues, auditing API calls, and troubleshooting generation failures at scale.
Describe the solution you'd like
Expose a hook or callback mechanism on the native model client that allows consumers to observe request/response data. This could be:
-
httpx event_hooks: The native client uses httpx internally. httpx supports
event_hooks={"request": [...], "response": [...]}on the client constructor. Exposing a way to inject these hooks (e.g. viaModelConfigor theModelClientfactory) would let downstream tools register logging callbacks without modifying DD internals. -
A dedicated logging transport: An optional httpx transport wrapper that logs request/response bodies before forwarding, similar to how
ThrottledModelClientwraps with throttling. -
RunConfig option: A
debug_log_requests: boolfield onRunConfigthat enables built-in request/response logging to a configurable path, handled entirely within DD.
Option 1 is the most flexible (consumers control what's logged). Option 3 is the most user-friendly.
Describe alternatives you've considered
- Keeping litellm as an optional dependency just for debug logging - adds unnecessary dependency weight
- Monkey-patching the httpx client after DD creates it - fragile and version-dependent
- Using Python logging at DEBUG level to capture httpx traffic - httpx logs at TRACE level which is very verbose and not structured
Agent Investigation
Explored DD 0.5.5 codebase:
- Native client lives in
packages/data-designer-engine/src/data_designer/engine/models/clients/ ThrottledModelClientwrapsModelClientwith per-request hooks (throttle acquire/release) - same pattern could wrap with loggingclients/retry.pybuilds httpxRetryTransport- the transport layer is already composable- No existing event_hooks, logging hooks, or callback mechanism on the client
clients/types.pydefinesChatCompletionRequest/Responsewhich contain the structured data that would need to be logged
Additional context
The previous litellm-based logger captured: timestamp, model name, full prompt messages, request kwargs, complete response body, and token usage per API call. Whatever replaces it should capture equivalent data. This is particularly useful when running large-scale generation jobs where individual request failures need to be diagnosed.
Checklist
- I've reviewed existing issues and the documentation
- This is a design proposal, not a "please build this" request
- 主要语言
- Python
- 星标
- 2.4k
- 派生
- 241
- 平均合并
- 1 天 1 小时
- 30 天内合并 PR
- 86
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NVIDIA-NeMo/DataDesigner 的其他 Issue
-
enhancement triaged
难度 2/5 1-3 小时 新手友好度 72/100
NVIDIA-NeMo/DataDesigner#1110 · 1 条评论 ·
维护者通常 1 天内回复
-
Local seed path containing a single quote breaks the DuckDB query可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 67/100
NVIDIA-NeMo/DataDesigner#1102 · 2 条评论 ·
维护者通常 1 天内回复
-
Code validation repeats the first result for subsequent target columns可能已有人在做 @edjson 于 2 天前认领。 未关闭bug triaged
难度 2/5 1-3 小时 新手友好度 77/100
NVIDIA-NeMo/DataDesigner#1092 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
enforce \from future import annotations` via ruff FA102 rule`可能已有人在做 @chethanuk 于 49 天前认领。 未关闭task
难度 2/5 1-3 小时 新手友好度 82/100
NVIDIA-NeMo/DataDesigner#760 ·
维护者通常 1 天内回复
-
Support image columns and media collection in multi-shard Slurm runs可能已有人在做 @nabinchha 今天认领。 未关闭enhancement
NVIDIA-NeMo/DataDesigner#1114 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 NVIDIA-NeMo/DataDesigner 的全部 Issue
相似的 Issue
-
bug
难度 1/5 1 小时以内 新手友好度 86/100
awslabs/visual-asset-management-system#937 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
-
follow-up
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 83/100
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 2 天内回复