Spaces:
Sleeping
Sleeping
metadata
title: CodeSecAudit RAG Service
emoji: 🛡️
colorFrom: blue
colorTo: purple
sdk: docker
app_port: 7860
pinned: false
CodeSecAudit RAG Service
Remote RAG microservice for OWASP cheat sheet retrieval. Deployed as a Hugging Face Space with Docker SDK.
Deploy
Create a new Space at https://huggingface.co/new-space
Choose Docker (not Streamlit/Gradio)
Set Space SDK to Docker
Copy these files:
Dockerfilestart.sh- The entire
rag_service/directory
Or use the automated script:
python scripts/deploy_hf_rag_space.pyAdd Secrets in Space Settings:
Secret Required Description RAG_API_KEYProduction Shared API key for request auth. If empty, the service is public — anyone can search. RAG_DATASET_REPONo HF dataset repo (default: OMCHOKSI108/CodeSecAudit-RAG)RAG_EMBEDDING_MODELNo Sentence-transformer model (default: sentence-transformers/all-MiniLM-L6-v2)Production: Always set
RAG_API_KEY. Without it, the service is public and anyone with the URL can query your RAG index.Space will build and start on port 7860.
Health check
curl https://your-space.hf.space/health
Search
curl -X POST https://your-space.hf.space/rag/search \
-H "Content-Type: application/json" \
-H "X-CodeSec-RAG-Key: your-key" \
-d '{"query":"sql injection prepared statements","top_k":3}'