Spaces:
Running
Running
Abdullah Meda
commited on
Commit
Β·
1be2f7c
1
Parent(s):
c6fe03c
minor edits
Browse files
README.md
CHANGED
@@ -16,18 +16,20 @@ short_description: Latest π€ documentation for LLMs and AI code editors
|
|
16 |
|
17 |
# HFContext7: Up-to-date π€ Docs for your LLM
|
18 |
|
19 |
-
|
20 |
|
21 |
You ask your AI assistant for a code snippet using the latest `diffusers` feature, and it confidently spits out code that was deprecated six months ago. You're trying to debug a `transformers` pipeline, and the LLM hallucinates parameters that don't exist. Sound familiar?
|
22 |
|
23 |
-
Large Language Models are powerful, but their knowledge is frozen in time
|
24 |
|
25 |
-
|
26 |
|
27 |
-
**HFContext7** is a Model Context Protocol (MCP) server that acts as a bridge between your AI assistant and the ever-evolving Hugging Face documentation. It provides your LLM with the ability to fetch the **single most relevant** documentation page for your query, ensuring the context it uses is fresh, accurate, and directly from the source
|
28 |
|
29 |
**Inspired by the (unfortunately closed-source) `Context7` project**, we wanted to build an open-source alternative focused specifically on the rich, complex, and rapidly changing Hugging Face ecosystem.
|
30 |
|
|
|
|
|
31 |
Simply add `use hfcontext7` to your prompt:
|
32 |
|
33 |
```txt
|
@@ -38,11 +40,13 @@ Create a LoRA fine-tuning script for Llama with PEFT. use hfcontext7
|
|
38 |
Set up a Gradio interface with Diffusers for image generation. use hfcontext7
|
39 |
```
|
40 |
|
41 |
-
|
|
|
|
|
42 |
|
43 |
---
|
44 |
|
45 |
-
|
46 |
|
47 |
Traditional RAG (Retrieval-Augmented Generation) on large documentation sets can be slow, expensive, and imprecise. Embedding entire libraries' worth of content leads to massive vector databases and often returns noisy, irrelevant chunks.
|
48 |
|
@@ -56,11 +60,11 @@ We took a different, more surgical approach:
|
|
56 |
* **Step 1: Candidate Search:** When you ask a question, we embed your query and perform a semantic search against our index of *file paths*. This instantly gives us the top 50 most likely documentation pages.
|
57 |
* **Step 2: LLM-Powered Selection:** We don't just dump all 50 files into the context. Instead, we generate a `tree`-like view of their file structure and present it to a powerful LLM (GPT-4o) along with your original question. The LLM's only job is to analyze this structure and choose the **one file** that is the most likely to contain the answer.
|
58 |
|
59 |
-
This approach is fast, cheap, and highly precise
|
60 |
|
61 |
---
|
62 |
|
63 |
-
|
64 |
|
65 |
Building HFContext7 wasn't straightforward. We faced a few key challenges:
|
66 |
|
@@ -72,7 +76,7 @@ Building HFContext7 wasn't straightforward. We faced a few key challenges:
|
|
72 |
|
73 |
---
|
74 |
|
75 |
-
|
76 |
|
77 |
HFContext7 is just getting started. Here's where we're headed:
|
78 |
|
@@ -85,7 +89,7 @@ HFContext7 is just getting started. Here's where we're headed:
|
|
85 |
|
86 |
---
|
87 |
|
88 |
-
|
89 |
|
90 |
This server exposes the following tools to an MCP client:
|
91 |
|
|
|
16 |
|
17 |
# HFContext7: Up-to-date π€ Docs for your LLM
|
18 |
|
19 |
+
## The Problem: Your LLM is stuck in the past
|
20 |
|
21 |
You ask your AI assistant for a code snippet using the latest `diffusers` feature, and it confidently spits out code that was deprecated six months ago. You're trying to debug a `transformers` pipeline, and the LLM hallucinates parameters that don't exist. Sound familiar?
|
22 |
|
23 |
+
Large Language Models are powerful, but their knowledge is frozen in time β°. The Hugging Face ecosystem, however, moves at lightning speed. This knowledge gap leads to wasted time, frustrating debugging sessions π€, and a reliance on constant tab-switching π to find the right documentation page.
|
24 |
|
25 |
+
## The Solution: Fresh Docs, Right in Your Prompt
|
26 |
|
27 |
+
**HFContext7** is a Model Context Protocol (MCP) server that acts as a bridge between your AI assistant and the ever-evolving Hugging Face documentation. It provides your LLM with the ability to fetch the **single most relevant** documentation page for your query, ensuring the context it uses is fresh, accurate, and directly from the source β‘.
|
28 |
|
29 |
**Inspired by the (unfortunately closed-source) `Context7` project**, we wanted to build an open-source alternative focused specifically on the rich, complex, and rapidly changing Hugging Face ecosystem.
|
30 |
|
31 |
+
Demo Link: https://youtu.be/O3QFfPo9DcM
|
32 |
+
|
33 |
Simply add `use hfcontext7` to your prompt:
|
34 |
|
35 |
```txt
|
|
|
40 |
Set up a Gradio interface with Diffusers for image generation. use hfcontext7
|
41 |
```
|
42 |
|
43 |
+
Was the documentation helpful in answering my query?
|
44 |
+
|
45 |
+
HFContext7 instantly provides your AI assistant with accurate, up-to-date HuggingFace documentation and code examples π―.
|
46 |
|
47 |
---
|
48 |
|
49 |
+
## Under the Hood: A Smarter RAG Pipeline βοΈ
|
50 |
|
51 |
Traditional RAG (Retrieval-Augmented Generation) on large documentation sets can be slow, expensive, and imprecise. Embedding entire libraries' worth of content leads to massive vector databases and often returns noisy, irrelevant chunks.
|
52 |
|
|
|
60 |
* **Step 1: Candidate Search:** When you ask a question, we embed your query and perform a semantic search against our index of *file paths*. This instantly gives us the top 50 most likely documentation pages.
|
61 |
* **Step 2: LLM-Powered Selection:** We don't just dump all 50 files into the context. Instead, we generate a `tree`-like view of their file structure and present it to a powerful LLM (GPT-4o) along with your original question. The LLM's only job is to analyze this structure and choose the **one file** that is the most likely to contain the answer.
|
62 |
|
63 |
+
This approach is fast, cheap, and highly precise π. It leverages the inherent structure of good documentation and uses a powerful reasoning engine for the final selection, ensuring you get the whole, relevant page, not just a random chunk.
|
64 |
|
65 |
---
|
66 |
|
67 |
+
## Challenges along the way
|
68 |
|
69 |
Building HFContext7 wasn't straightforward. We faced a few key challenges:
|
70 |
|
|
|
76 |
|
77 |
---
|
78 |
|
79 |
+
## Roadmap for the Future
|
80 |
|
81 |
HFContext7 is just getting started. Here's where we're headed:
|
82 |
|
|
|
89 |
|
90 |
---
|
91 |
|
92 |
+
## Available Tools
|
93 |
|
94 |
This server exposes the following tools to an MCP client:
|
95 |
|
app.py
CHANGED
@@ -166,8 +166,6 @@ list_resources_demo = gr.Interface(
|
|
166 |
fn=list_huggingface_resources_names,
|
167 |
inputs=[],
|
168 |
outputs="json",
|
169 |
-
title="HuggingFace Ecosystem Explorer",
|
170 |
-
description="Explore the names of the libraries, services, and other resources available within the HuggingFace ecosystem",
|
171 |
)
|
172 |
|
173 |
get_docs_demo = gr.Interface(
|
|
|
166 |
fn=list_huggingface_resources_names,
|
167 |
inputs=[],
|
168 |
outputs="json",
|
|
|
|
|
169 |
)
|
170 |
|
171 |
get_docs_demo = gr.Interface(
|