Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Hugging Face 33 min read How-to mediumAdept

How we leveraged distilabel to create an Argilla 2.0 Chatbot

A domain-specific documentation chatbot for Argilla 2.0 is built by chunking the project's markdown docs into ~256-token pieces and using distilabel with Llama-3-70B-Instruct to generate synthetic query triplets (anchor, positive, hard negative). A custom MultipleQueries task triples the positives to augment the 251-chunk dataset. The triplets fine-tune a Sentence Transformers embedding model, which populates a vector database of doc chunks stored on the Hugging Face Hub. The result is a Gradio app deployed to Hugging Face Spaces that logs conversations to Argilla for ongoing evaluation.

Assumes: RAG basicsPythonembedding modelsLLM prompting

Related posts

  • Building Data-Aware AI Applications with Heroku AI and LlamaIndex

    Heroku Engineering mediumAdept

    A RAG stack on Heroku pairs LlamaIndex for ingestion, indexing and retrieval with Heroku Managed Inference (Claude 4 Sonnet via an OpenAI-compatible API), Cohere Embed Multilingual for embeddings, and Heroku Postgres with pgvector as the vector store. The walkthrough provisions the add-ons via the Heroku CLI. It then shows Python code that points LlamaIndex's OpenAILikeEmbedding at Heroku's embedding endpoint, stores 1024-dimension vectors in PGVectorStore, and queries documents through a query engine. Example use cases include financial report analysis, insurance claim agents and support chatbots.

  • Hugging Face x LangChain : A new partner package

    Hugging Face mediumAdept

    langchain-huggingface is a new Python partner package jointly maintained by Hugging Face and LangChain, replacing community-written integrations that had drifted out of date. It provides HuggingFacePipeline for running transformers models locally, HuggingFaceEndpoint for the serverless Inference API or deployed TGI endpoints via InferenceClient, and ChatHuggingFace, which turns message lists into model-specific prompts with tokenizer.apply_chat_template. For embeddings it offers HuggingFaceEmbeddings (local sentence-transformers) and HuggingFaceEndpointEmbeddings (Hub or TEI instances), each shown with short code examples.

  • Build a Domain-Specific Embedding Model in Under a Day

    Hugging Face mediumAdept

    A single-GPU pipeline fine-tunes Llama-Nemotron-Embed-1B-v2 for a specific domain in under a day without manual labels. An LLM generates synthetic single- and multi-hop QA pairs from raw documents, which are quality-filtered. The base model then mines hard negatives, using a 95% margin ceiling to avoid false negatives. Training is a contrastive biencoder run at temperature 0.02, followed by BEIR evaluation, ONNX/TensorRT export and serving through NIM. On NVIDIA docs this gave about 10% gains in NDCG@10 and Recall@10, and Atlassian raised Jira Recall@60 from 0.751 to 0.951. The guide also covers practical defaults: 1–2 epochs for real data, LR 1e-5, and 1 positive plus 4 hard negatives per query.

  • Investing in Performance: Fine-tune small models with LLM insights - a CFM case study

    Hugging Face mediumAdept

    Capital Fund Management built a financial named-entity recognition pipeline that extracts company names from Benzinga news headlines in the FNSPID dataset. Llama 3.1-70B, served on Hugging Face Inference Endpoints, pre-labels the headlines using a structured few-shot prompt and JSON-schema guided output, and humans then review those labels in Argilla. Fine-tuning compact models such as GLiNER and SpanMarker on the curated labels raises F1 to 93.4% and 90.1%. That approaches the 95% zero-shot F1 of Llama 3.1-70B at up to 80x lower inference cost. The walkthrough includes endpoint setup, prompt design, async batched requests with AsyncInferenceClient, and a comparison against weak supervision.

  • Mistral 7B and BAAI on Workers AI vs. OpenAI Models for RAG

    Neon mediumAdept

    Swapping gpt-3.5-turbo for mistral-7b-instruct-v0.1 and text-embedding-ada-002 for BAAI's bge-base-en-v1.5 (both on Cloudflare Workers AI) in Neon's docs chatbot shows embeddings are close to interchangeable but text generation is not. Across eight Postgres questions, the two embedding models returned the same retrieved chunks 46% of the time at k=3 (42% at k=10), with Jaccard and TF-IDF cosine scores indicating substantial context overlap. Expert raters scored GPT-3.5 answers 3.8/5 versus 2.5/5 for Mistral 7B. Migrating embeddings to BGE looks viable and can cut vector storage, while replacing the generation model would noticeably hurt answer quality.

The quest for software engineering knowledge.

Look:
Layout: