Skip to content

Implement reusable code snippets for documentation#55

Merged
alay2shah merged 6 commits intomainfrom
alay2shah/reusable-snippets
Feb 7, 2026
Merged

Implement reusable code snippets for documentation#55
alay2shah merged 6 commits intomainfrom
alay2shah/reusable-snippets

Conversation

@alay2shah
Copy link
Contributor

Summary

Eliminated code drift between model pages and main inference documentation by implementing reusable JSX snippet components and standardizing code examples across the entire codebase.

Changes

  • Created 6 reusable snippet components (snippets/quickstart/) for text & vision models (Transformers, vLLM, llama.cpp)
  • Refactored 13 model pages (9 text + 4 vision) to use snippets instead of inline code
  • Fixed install commands on 7 nano model pages (transformers>=5.0.0, hf download, vllm==0.14)
  • Standardized torch_dtypedtype across inference pages (new correct parameter name)
  • Fixed Vision snippet callouts (markdown backticks now render as JSX code blocks inside Note components)
  • Created MODEL-MATRIX.md as maintainer source-of-truth for model implementations (excluded via .mintignore)

All code examples now match main inference pages exactly (same install commands, version pins, code patterns, parameter values).

Verification

  • All 21 model pages + main inference pages tested with mintlify dev (HTTP 200, no errors)
  • No syntax highlighting issues or broken imports
  • 563 lines of code removed through consolidation (-993 / +430 net)

Note on Styling

Reusable JSX snippets have slightly simplified styling vs. native fenced code blocks (no token-level syntax highlighting, no copy button), but maintain consistent visual frame and correctly interpolate model IDs. This is a necessary trade-off for achieving parameterized snippets since Mintlify's {variable} interpolation doesn't work inside fenced code blocks.

🤖 Generated with Claude Code

alay2shah and others added 5 commits February 6, 2026 18:24
Create 6 JSX snippet components for text and vision model quick starts
(Transformers, vLLM, llama.cpp). Add MODEL-MATRIX.md as maintainer
source-of-truth, excluded from Mintlify via .mintignore.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace inline Quick Start code on 9 text model pages with shared
snippet components, ensuring consistent code examples across all pages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace inline Quick Start code on 4 VL model pages with shared
snippet components for Transformers, vLLM, and llama.cpp.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Standardize install commands: transformers>=5.0.0, accelerate,
vllm==0.14. Replace huggingface-cli download with hf download.
Add dtype and model_id variable pattern to base model page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
dtype is the new correct parameter name for from_pretrained().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@alay2shah alay2shah force-pushed the alay2shah/reusable-snippets branch from 58023c9 to fdfecff Compare February 6, 2026 23:24
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mlabonne
Copy link
Collaborator

mlabonne commented Feb 7, 2026

Nice, I like the reusable approach

Copy link
Collaborator

@mlabonne mlabonne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@alay2shah alay2shah merged commit 9bb2d64 into main Feb 7, 2026
6 checks passed
@alay2shah alay2shah deleted the alay2shah/reusable-snippets branch February 7, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants