Instructions to use erukude/rag-audit-judge with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use erukude/rag-audit-judge with PEFT:
Task type is invalid.
- Transformers
How to use erukude/rag-audit-judge with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="erukude/rag-audit-judge")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("erukude/rag-audit-judge", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use erukude/rag-audit-judge with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "erukude/rag-audit-judge" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "erukude/rag-audit-judge", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/erukude/rag-audit-judge
- SGLang
How to use erukude/rag-audit-judge 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 "erukude/rag-audit-judge" \ --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": "erukude/rag-audit-judge", "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 "erukude/rag-audit-judge" \ --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": "erukude/rag-audit-judge", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Unsloth Studio
How to use erukude/rag-audit-judge with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for erukude/rag-audit-judge to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for erukude/rag-audit-judge to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for erukude/rag-audit-judge to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="erukude/rag-audit-judge", max_seq_length=2048, ) - Docker Model Runner
How to use erukude/rag-audit-judge with Docker Model Runner:
docker model run hf.co/erukude/rag-audit-judge
RAG Audit Judge
RAG Audit Judge is a small local evaluator for retrieval-augmented generation (RAG) answers. It is trained to inspect a question, supplied retrieval context, and candidate answer, then return exactly one JSON audit object.
Expected output shape:
{
"groundedness_score": 0.82,
"hallucination_risk": "low",
"citation_quality": "medium",
"issues": [],
"recommended_fix": ""
}
Included Artifacts
lora-1b/: PEFT LoRA adapter trained fromunsloth/Llama-3.2-1B-Instruct-bnb-4bitlora-3b/: PEFT LoRA adapter trained fromunsloth/Llama-3.2-3B-Instruct-bnb-4bittrain_data.json: 108 supervised examples for RAG answer auditingfine_tune.ipynb: Colab/CUDA notebook used to train and export adaptersModelfile: Ollama Modelfile for the 3B GGUF LoRA adapter
The referenced rag-audit-judge-1b.gguf and rag-audit-judge-3b.gguf files are
not included in this local repo yet. Generate them from the LoRA adapter folders
before using the Ollama Modelfile.
Intended Use
Provide the model with:
- a user question
- retrieved context entries with stable source IDs
- the candidate answer to audit
The judge should evaluate only the supplied context, not outside knowledge. It is intended for development-time or local automation checks around RAG answer quality, citation coverage, unsupported claims, overconfidence, and sensitive information exposure.
Example input:
Question: Can I return a headset?
Context:
- id: refund-policy
text: Headsets can be returned within 30 days if they are unopened.
Candidate answer:
An unopened headset can be returned within 30 days, and a $5 restocking fee always applies [refund-policy].
Example output:
{
"groundedness_score": 0.55,
"hallucination_risk": "medium",
"citation_quality": "medium",
"issues": [
"The $5 restocking fee is not supported by the supplied context."
],
"recommended_fix": "Remove the restocking-fee claim or provide context that supports it."
}
Training Details
The adapters were trained with Unsloth and TRL SFT on JSON-formatted examples. The dataset contains 108 examples with target audits covering low, medium, and high hallucination-risk labels and citation quality labels.
LoRA configuration:
- rank: 32
- alpha: 64
- dropout: 0
- target modules:
q_proj,k_proj,v_proj,o_proj,gate_proj,up_proj,down_proj - sequence length: 3072
- epochs: 5
- batch size per device: 2
- gradient accumulation steps: 4
- learning rate: 2e-4
- PEFT: 0.19.1
Loading With Transformers/PEFT
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base_model = "unsloth/Llama-3.2-3B-Instruct-bnb-4bit"
adapter_path = "lora-3b"
tokenizer = AutoTokenizer.from_pretrained(adapter_path)
model = AutoModelForCausalLM.from_pretrained(base_model, device_map="auto")
model = PeftModel.from_pretrained(model, adapter_path)
Use lora-1b with the 1B base model if you need a smaller local adapter.
Ollama
After converting a LoRA adapter to GGUF, update or use Modelfile:
ollama create rag-audit-judge -f Modelfile
ollama run rag-audit-judge
For llama.cpp conversion, the notes file contains the command pattern used locally:
python llama.cpp/convert_lora_to_gguf.py \
./rag-audit-judge/lora-3b \
--outfile ./rag-audit-judge/rag-audit-judge-3b.gguf \
--outtype f16 \
--base-model-id unsloth/Llama-3.2-3B-Instruct-bnb-4bit
- Downloads last month
- 43
We're not able to determine the quantization variants.
Model tree for erukude/rag-audit-judge
Base model
meta-llama/Llama-3.2-1B-Instruct