Repository navigation
Release 0.3.0 - #98
Merged
Merged
Conversation
Merge release/0.2.2 into devel
The gguf integration patched only Llama.__call__, but create_chat_completion() runs llama.create_completion() through the chat handler, so chat apps produced no inference events. Patch create_completion instead: __call__, create_completion and create_chat_completion all run it, so each call is tracked once. patch_instance_call_once takes a method name (default __call__). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…N comes from Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
README: PyPI badge, links to the app, docs and blog, and where the DS…
mlx 0.22.0 is gone from PyPI, which broke the daily run. Current pins move to the latest releases; numpy 2.2.6 is the newest that covers 3.10 to 3.13, with 3.10 overrides for onnxruntime and keras. Anthropic had pins and a test but was missing from the CI matrix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
create_chat_completion now exposes its messages to the create_completion it runs, so chat events get prompt_type="chat" and turn_index while tracking stays in one place. Non-streamed calls report finish_reason, every call reports its sampling arguments with the method's defaults filled in, and with attachments enabled the prompt or messages and the reply are attached. Closes #64
Every compat test used importorskip, so a broken install skipped and the job passed (ultralytics min on 3.12/3.13 did), and half of them only called instrument(). Each test now loads a real model with the pinned library and checks the load and inference events, without network access: canned HTTP for openai and anthropic, small committed ONNX and GGUF files, and models built from config for the rest. A conftest hook fails any skip. Bugs found are marked xfail(strict=True) with their issue: #64, #70, #71, #72, #73. tests/compat is left out of the regular pytest run.
…el PRs The workflow's matrix was hand-written and drifted from the script (anthropic was missing), and pull requests into devel never ran compat. compat_matrix.py now builds the matrix: a pr profile with each integration's min and current pins, and the full nightly profile. A verify step checks the installed versions match the pins. tests/test_compat_matrix.py keeps the script, the compat tests and docs/compatibility.md in step.
ultralytics 8.0.0 imports pkg_resources without declaring setuptools, and Python 3.12+ environments no longer include it. The old compat test skipped here; with skips now failing, the full run caught it.
Every devel pull request running the matrix is more than needed; devel gets the nightly run. Pull requests into main or a release branch run the full matrix, so the separate pr profile is gone.
The gguf compat test fetches the 1.2 MB TinyStories model from a pinned Hugging Face revision on first use and checks its sha256. A broken link or changed file fails the test with the URL to update. Models are cached in tests/compat/.cache, which the gguf jobs keep between runs.
Fix the compat matrix and make it test each integration
Replaces the #64 xfail with compat tests for create_completion (stop reason and generation config with defaults), create_chat_completion (prompt_type, turn_index) and streamed chat, each tracked once. They fail on devel and pass with this branch on llama-cpp-python 0.2.90 and 0.3.36.
The example only called llm(...). It now runs three streamed create_chat_completion turns and one create_completion, so it exercises the chat tracking from this PR.
Lint was only run by hand, so misplaced imports and similar slips reached review. CI gets a lint job running ruff check and ruff format --check, and the rule set adds bugbear (B), comprehensions (C4), PIE, import placement (PLC0415), pytest style (PT), RET, RUF and SIM. Test doubles may keep mutable class attributes (RUF012).
Mostly mechanical: sorted __all__, removed unused noqa directives, dropped else after return, dict literals, itertools.pairwise, ClassVar on the client's class-level tables, contextlib.suppress in the hub cache walk, and an explicit zip strict flag (strict where lengths must match, not where a list can fall back to empty). llm_api imports get_client at module level: the import cycle its noqa mentioned no longer exists.
Imports move to module level, except numpy, which stays optional through pytest.importorskip; the sampler test reads platforms._sampler at call time since start_sampler replaces it. Also tuple parametrize names, split composite asserts, combined with statements, match= on pytest.raises, raise from None in fake async iterators, and a duplicate parametrize case removed.
Track llama-cpp chat and completion calls in the gguf integration
Ingest rejects the whole batch with 422 when a span attribute value is a list or dict, so one bad value dropped every unrelated event sent with it. SpanEvent.to_dict now sends such values as JSON strings and logs one warning per key. Closes #61
Send non-scalar span attributes as JSON strings
close() stopped the uploader without a final pass, so attachments captured in the last few seconds stayed on disk while their events were sent. With a timeout, close() and flush() now drain the attachment store in the time left after the event flush. Each request's timeout is capped at that deadline, and a lock keeps the background thread and the drain from sending the same attachment. Closes #62
Upload buffered attachments on close and flush with a timeout
main_graph, the default graph name from newer torch.onnx.export, wasn't in the generic list, so every Piper voice registered as one model called main_graph. It now falls back to the session's file name, which also gives a manually registered session an id. model_version 0, negative or INT64_MAX counts as unset. Closes #63
Improve README quickstart and add demo preview
Add compact trace and SQL previews to README
openai 1.30.0 passes proxies= to httpx, which httpx 0.28 removed.
…s a change Drops the llama.cpp line about automatic prompt and reply attachments, which the explicit-attachments change removed.
The fork hooks hold the drain lock across fork() so a child never inherits it locked.
init(dsn=...) now reuses the default client when the DSN points to the same project. A second client enabling integrations while another live client owns them logs a warning and leaves automatic tracking with the owner, as 0.2.2 did silently. wildedge run --strict-integrations keeps the RuntimeError.
Release 0.3.0
getattr on transformers' lazy modules imported unused model modules and logged a debug line for each one that failed to import.
Stop the Hugging Face hub patch from importing unused transformers modules
Changelog preview for
|
Coverage report
Top uncovered files
|
The integrations cut error messages to ERROR_MSG_MAX_LEN and provider codes to PROVIDER_ERROR_CODE_MAX_LEN before calling track_error(). Manual calls sent the full text. ErrorEvent now applies both limits when serializing, so every error event gets them.
Measured across 37 typical failures, 9 messages were over 200 characters. Several put their cause at the end. mlx-whisper audio errors start with the ffmpeg banner, and torch state_dict errors end with the shapes. The integrations kept only the first 200 characters. ErrorEvent now keeps the start and the end of a message over 500 characters, with an ellipsis between. The integrations and decorators no longer cut the message themselves, so the limit is applied once.
The notes listed every commit subject since the previous tag, including merge commits and release housekeeping such as changelog moves. They are now the curated CHANGELOG.md section for the version. A missing or empty section fails the build instead of publishing empty notes.
Cap error fields in every error event and build release notes from CHANGELOG.md
0.2.x already uploaded only explicit attachments. Automatic GGUF capture was added and removed during 0.3.0 development and never shipped, so the entry described no change for users upgrading.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release 0.3.0 to main. Tag
v0.3.0on the merge commit.Highlights (full list in CHANGELOG):
mlx_whisperandfaster_whisper, OpenAIresponses.create()andembeddings.create(), Anthropicmessages.stream().llama_cpp(ggufremains an alias) and now tracks chat and completion calls.init(dsn=...)with the runner's DSN reuses its client. A conflicting second client warns, and--strict-integrationsraises (Release 0.3.0 #96).flush()(Release 0.3.0 #96), transformers double counting, timm and ONNX model naming, Hugging Face hub patch importing unused transformers modules (Stop the Hugging Face hub patch from importing unused transformers modules #97).This PR also moves the Hugging Face hub entry from Unreleased into the 0.3.0 section, since #97 merged before tagging.
Verification on this branch
twine check.check_tag_version.py, the release notes script andllms.txtall run.llm_api, the cli wrapper, FastAPI with--reload, Django with waitress, and the README snippets.init()pattern underwildedge run, the same-DSN, other-DSN and strict cases, the flush race script (0 duplicates), a realfork(), and the Hugging Face hub patch (no extra imports, download functions still tracked).🤖 Generated with Claude Code