Open Source

Finally found a reason to use local models 😭

⚡A developer's local LLM workflow for internal linking reveals surprising trade-offs between embedding models and full reasoning.

Deep Dive

A developer has shared a detailed workflow for using local LLMs to solve a practical web development problem: automatically generating internal links across a 400-page static website. Faced with the daunting task of manually connecting related content, they employed a two-stage process. First, they used Anthropic's Claude Code to create a metadata map (title, slug, description, tags) for all pages. Then, they queried the local Gemma 3 27B model in chunks, asking it to identify relevant pages from the map for linking. The initial attempt failed because the existing tags were too broad, leading the model to suggest irrelevant links.

The developer then refined their approach by using Claude Code again to create a script that passed every post through the Gemma 3 model to generate new, specific tags from a predefined set. This data cleanup was crucial for success. In a follow-up experiment prompted by community feedback, they tested the EmbeddingGemma 300M model for a vector similarity approach. While this method was significantly faster and created a compact 6MB JSON file of embeddings, it failed to capture the nuanced relationships needed for precise inline linking—for instance, it didn't connect 'astrophotography' to related pages like 'travel photography.' This highlighted a key limitation: embedding-based similarity scores were too low for the required context, forcing a compromise with a less-integrated 'Related Pages' section instead of inline links.

Key Points
  • Used a local Gemma 3 27B model to iteratively analyze and link 400 MDX files for a static site.
  • Data quality was critical; a second Claude Code script was needed to retag all posts with specific tags for the LLM to work effectively.
  • Testing with EmbeddingGemma 300M revealed speed benefits but failed at nuanced contextual linking, showcasing a trade-off between efficiency and reasoning.

Why It Matters

This real-world case study demonstrates the practical utility and specific limitations of local LLMs versus embedding models for complex content analysis tasks.