Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

gguf integration does not track create_chat_completion or create_completion

Đã đóng
#64 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
devtools, machine-learning, python
Lĩnh vực
ai, observability

Hướng nghiên cứu

Start with the existing GGUF instrumentation around Llama.__call__, then inspect create_completion and create_chat_completion behavior in the llama-cpp-python integration. Trace streaming and non-streaming result objects to verify usage, finish reasons, generation configuration, chat metadata, and attachment handling. Add or update integration tests so each entry point is tracked once and __call__ does not double-count.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

What happens

The gguf integration only tracks Llama.__call__. Llama.create_chat_completion is not tracked: llama-cpp-python's chat handlers call llama.create_completion(...) directly (llama_chat_format.py), so they never go through the patched __call__. create_completion called directly is missed too.

Chat completion is the usual way to run an instruct model, so an app using it gets the model load event and nothing else. It has to register the model with auto_instrument=False and build track_inference itself: TextInputMeta, GenerationOutputMeta from usage and finish_reason, and GenerationConfig from the call's keyword arguments.

Expected

Track create_completion and create_chat_completion (streaming and non-streaming), once per call:

  • tokens in and out, tokens per second and stop reason from the result's usage and choices[0].finish_reason
  • GenerationConfig from temperature, top_p, max_tokens and repeat_penalty
  • TextInputMeta with prompt_type="chat" and the number of user turns, for chat calls
  • when attachments are enabled, the messages as input and the reply as output

__call__ delegates to create_completion, so patching create_completion would cover all three without double counting.

Found in evil-jarvis, which tracks this by hand today (src/evil_jarvis/telemetry.py, track_generation). SDK 0.2.2, llama-cpp-python 0.3.x.

🤖 Generated with Claude Code

Ngôn ngữ chính
Python
Star
17
Fork
1
Merge trung bình
17 giờ 5 phút
Pull request đã merge (30 ngày)
34

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của wild-edge/wildedge-python

Tất cả issue của wild-edge/wildedge-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.