Repository navigation
fix(cosmos3/nim): document Git LFS for example media and fail fast on LFS pointers - #438
Merged
Merged
Conversation
… LFS pointers Signed-off-by: Aishwarya Madisetty <aishwarya9869@gmail.com>
aishmadise
marked this pull request as draft
November 26, 2026 03:23
aishmadise
marked this pull request as ready for review
November 26, 2026 03:25
satishra-ai
approved these changes
Dec 3, 2026
satishra-ai
left a comment
Collaborator
There was a problem hiding this comment.
Good to merge. The base encoded Git LFS pointers as media. The fix rejected the pointer with an actionable error, and the hydrated MP4 encoded correctly with a matching checksum.
pengcuo
approved these changes
Dec 3, 2026
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.
Problem
The example images and videos under
.agents/skills/cookbooks/cosmos3/are stored with Git LFS (via the*.mp4,*.jpg,*.pngrules in.gitattributes). Cloning without Git LFS leaves ~130-byte text pointers in their place. The top-level README installsgit-lfs, but none of the NIM cookbook pages mention it, so someone starting from the cookbook can end up sending pointer files to the NIM.media_to_data_url()checks that the file exists and has a supported extension, then base64-encodes whatever is on disk, so a pointer passes both checks.The
cosmos3-inference-nimagent skill (#384) already tells agents to materialise LFS inputs; this brings the same guidance to the human-facing cookbook README and adds a guard in the shared helper.Change
nim/README.md: a short note under "Use an Existing NIM Endpoint" to installgit-lfsand pull the cookbook assets before running examples.nim/examples/common.py:media_to_data_url()raises a clearValueErrorwhen the file is a Git LFS pointer, instead of sending it. This covers every example that uses the helper.Testing
Fresh clone without Git LFS (media files are pointers), using the pinned client environment (
uv sync --lockedinnim/), running from.agents/skills/cookbooks/cosmos3/nim:uv run python -c "import sys; sys.path.insert(0, 'examples'); from pathlib import Path; from common import media_to_data_url; print(media_to_data_url(Path('../generator/transfer/assets/edge/control_edge.mp4'))[:70])"Before (the pointer text is encoded and would be sent as video; the base64 decodes to
version https://git-lfs.github.com/s):After:
A regular (non-pointer) file still encodes normally.
just lintpasses. Not tested end to end against a running NIM.I ran into this while working through the NIM cookbook on a fresh Brev instance.