Text Generation
Transformers
edge-impulse
rag
retrieval-augmented-generation
faiss
qwen
api
documentation
tinyml
edge-ai
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", device_map="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
File size: 3,149 Bytes
4de1825 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | ---
license: apache-2.0
base_model: edgeimpulse/edgeimpulse-docs-qwen-0.5b
pipeline_tag: text-generation
library_name: transformers
tags:
- edge-impulse
- rag
- retrieval-augmented-generation
- faiss
- qwen
- api
- documentation
- tinyml
- edge-ai
---
# 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`](https://huggingface.co/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 with
`sentence-transformers/all-MiniLM-L6-v2` (384-dim).
- **Generation:** [`edgeimpulse/edgeimpulse-docs-qwen-0.5b`](https://huggingface.co/edgeimpulse/edgeimpulse-docs-qwen-0.5b)
via 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
```bash
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:
```bash
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:
```bash
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`](https://huggingface.co/edgeimpulse/edgeimpulse-docs-rag)
assistant instead.
## License
Apache-2.0. Documentation content belongs to Edge Impulse.
|