Downloads · 30 days
14
12% of all-time downloads
Debarun12/aws-enterprise-assistant-qwen2.5-7b-qlora
aws-enterprise-assistant-qwen2.5-7b-qlora is a question answering model from Debarun12. Use it when the input is a question plus a passage. It is set up for peft. The card lists the license as apache-2.0.
A domain-specific AI assistant fine-tuned on official AWS documentation using QLoRA (Quantized Low-Rank Adaptation). Answers questions about AWS services with grounded, accurate responses and refuses out-of-scope ques…
Downloads · 30 days
14
12% of all-time downloads
All-time downloads
116
Public
Repo size
21.5 MB
Likes
0
Public
Click a slice to open those files.
.json14.2 MB · 55%
From the Hugging Face model README
A domain-specific AI assistant fine-tuned on official AWS documentation using QLoRA (Quantized Low-Rank Adaptation). Answers questions about AWS services with grounded, accurate responses and refuses out-of-scope questions.
This model is a QLoRA fine-tune of Qwen2.5-7B-Instruct, trained on 407 instruction-following Q&A pairs generated from official AWS documentation. It is designed to answer questions about AWS cloud services accurately, with built-in domain refusal for non-AWS questions. The full system includes FAISS-based retrieval (RAG) and a FastAPI backend.
Load the adapter on top of Qwen2.5-7B-Instruct to answer AWS-related questions about EC2, S3, Lambda, IAM, RDS, VPC, CloudWatch, and DynamoDB.
Plug into a RAG pipeline with a FAISS vector store built from AWS documentation chunks for grounded, source-cited answers. A FastAPI backend with streaming support is included in the project repository.
This model is not intended for general-purpose conversation, code generation, or non-AWS topics. It will refuse questions outside the AWS domain by design.
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
from peft import PeftModel
import torch
base_model_name = "Qwen/Qwen2.5-7B-Instruct"
adapter_name = "Debarun12/aws-enterprise-assistant-qwen2.5-7b-qlora"
# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained(adapter_name, trust_remote_code=True)
# Load base model in 4-bit
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16,
bnb_4bit_use_double_quant=True,
)
base_model = AutoModelForCausalLM.from_pretrained(
base_model_name,
quantization_config=bnb_config,
device_map="auto",
trust_remote_code=True,
torch_dtype=torch.bfloat16,
)
# Load LoRA adapter
model = PeftModel.from_pretrained(base_model, adapter_name)
model.eval()
# Inference
messages = [
{"role": "system", "content": "You are an expert AWS cloud assistant."},
{"role": "user", "content": "What is the difference between IAM roles and IAM users?"},
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.inference_mode():
outputs = model.generate(**inputs, max_new_tokens=300, temperature=0.3, do_sample=True)
answer = tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)
print(answer)
Raw HTML pages were scraped from AWS documentation, cleaned with BeautifulSoup, and chunked into 512-word overlapping segments. Each chunk was passed to a local Qwen2.5-7B model to generate factual and procedural Q&A pairs in Alpaca instruction format. Pairs were formatted using Qwen2.5's chat template via apply_chat_template.
9 held-out questions covering all 8 AWS services, plus 3 out-of-scope questions for refusal testing.
Confidence scores are derived from cosine similarity between query embeddings and retrieved documentation chunks (FAISS IndexFlatIP with normalized vectors).
| Question Type | Avg Confidence | Refused Correctly |
|---|---|---|
| S3 (encryption, storage) | 0.724 | N/A |
| IAM (roles vs users) | 0.686 | N/A |
| Lambda (concurrency) | 0.680 | N/A |
| CloudWatch (monitoring) | 0.783 | N/A |
| DynamoDB (components) | 0.694 | N/A |
| DynamoDB (high availability) | 0.739 | N/A |
| DynamoDB (auto-scaling) | 0.688 | N/A |
| Out-of-scope (3 questions) | 0.000 | ✅ 100% |
The model achieves consistent confidence scores of 0.68–0.78 on AWS domain questions and correctly refuses 100% of out-of-scope questions. Answers are grounded in retrieved AWS documentation via FAISS RAG.
Always verify critical AWS configuration decisions against the official AWS documentation. Use the confidence score as a signal — responses below 0.5 should be treated with caution.
Debarun Das — GitHub | HuggingFace