Instructions to use edgeimpulse/edgeimpulse-api-docs-rag with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use edgeimpulse/edgeimpulse-api-docs-rag with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="edgeimpulse/edgeimpulse-api-docs-rag")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("edgeimpulse/edgeimpulse-api-docs-rag", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use edgeimpulse/edgeimpulse-api-docs-rag with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "edgeimpulse/edgeimpulse-api-docs-rag" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "edgeimpulse/edgeimpulse-api-docs-rag", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/edgeimpulse/edgeimpulse-api-docs-rag
- SGLang
How to use edgeimpulse/edgeimpulse-api-docs-rag with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "edgeimpulse/edgeimpulse-api-docs-rag" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "edgeimpulse/edgeimpulse-api-docs-rag", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "edgeimpulse/edgeimpulse-api-docs-rag" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "edgeimpulse/edgeimpulse-api-docs-rag", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use edgeimpulse/edgeimpulse-api-docs-rag with Docker Model Runner:
docker model run hf.co/edgeimpulse/edgeimpulse-api-docs-rag
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("edgeimpulse/edgeimpulse-api-docs-rag", dtype="auto")Edge Impulse API Docs β RAG Assistant
A focused retrieval-augmented assistant for the Edge Impulse API reference
(Studio API, ingestion API, remote-management API). Same runtime as the full
edgeimpulse/edgeimpulse-docs-rag
assistant, but the knowledge base is restricted to the API documentation so
retrieval stays tightly on-topic for integration and automation questions.
- Scope: Edge Impulse API reference only (
apis,apis_studio,apis_ingestion,apis_remote-management). - Retrieval: FAISS (inner-product) over
data/index, embedded withsentence-transformers/all-MiniLM-L6-v2(384-dim). - Generation:
edgeimpulse/edgeimpulse-docs-qwen-0.5bvia any OpenAI-compatible endpoint (llama.cpp or Ollama).
This repo ships only the prebuilt (API-scoped) index and the inference code β no raw corpus and no index-building pipeline.
Contents
| File | Purpose |
|---|---|
data/index/edge_impulse_docs.faiss |
FAISS index of the API-reference chunks |
data/index/chunks.pkl |
Chunk text + source metadata (aligned to the index) |
data/index/metadata.json |
Embedding model + index parameters (scope: edge-impulse-api-reference) |
rag.py |
Retrieval + grounded generation (CLI + importable) |
serve.py |
Minimal Flask HTTP API (POST /ask) |
requirements.txt |
Runtime dependencies |
Quickstart
pip install -r requirements.txt
hf download edgeimpulse/edgeimpulse-api-docs-rag --local-dir edgeimpulse-api-docs-rag
cd edgeimpulse-api-docs-rag
# start the generator (llama.cpp)
hf download edgeimpulse/edgeimpulse-docs-qwen-0.5b qwen-edgeai-q4_k_m.gguf --local-dir .
llama-server -m qwen-edgeai-q4_k_m.gguf -c 4096 --port 8080 --jinja
# ask an API question
python rag.py "How do I create an Edge Impulse API key?"
python rag.py "How do I upload data with the ingestion API?" --no-generate
Serve over HTTP:
python serve.py --host 0.0.0.0 --port 8000
curl -s localhost:8000/ask -H 'content-type: application/json' \
-d '{"question": "How do I classify an image via the API?"}'
Configuration
rag.py honours RAG_INDEX_DIR, RAG_API_BASE, and RAG_MODEL (see the full
assistant's card for details). For Ollama:
export RAG_API_BASE=http://127.0.0.1:11434/v1
export RAG_MODEL=hf.co/edgeimpulse/edgeimpulse-docs-qwen-0.5b
Notes
Because the corpus is intentionally narrow, questions outside the API reference
may return "not in context" β that is by design. For general docs questions
(devices, deployment targets, ML concepts) use the full
edgeimpulse/edgeimpulse-docs-rag
assistant instead.
License
Apache-2.0. Documentation content belongs to Edge Impulse.
Model tree for edgeimpulse/edgeimpulse-api-docs-rag
Base model
Qwen/Qwen2.5-0.5B
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="edgeimpulse/edgeimpulse-api-docs-rag")