SmallChungus1/LoRA_RAG_for_Rust

LORA-finetuned SLM + RAG for Rust-related question answering

0

stars

24

commits

Jupyter Notebook

primary language

Feb 10, 2026

updated

README

In this project I finetuned HuggingFace SLMs (Qwen 0.6B, Smollm2 135M) with Lora on 5k synthetically generated Rust Programming question-answer pairs. The model is paired with RAG (chromaDB, LangChain) to answer Rust-related questions using a Rust Programming textbook for grounding. It also contains a evaluation script that uses a Judge LLM (Qwen 4b model) to evaluate the finetuned model against baseline on rust_qa_500_bench.jsonl.

Usage:

  • create venv and install dependencies python -m venv .venv source .venv/bin/activate pip install -r requirements.txt
  • to start up the StreamLit App: streamlit run app.py
  • to run the evaluation script: python eval/eval_script.py

Repo overview:

cs_rag_llm_lora_finetune.ipynb: LORA finetuning code using HuggingFace's PEFT and TRL libs and their models. Training was done through Google Colab, using an L4 GPU.

data_gen: folder with code for calling larger Qwen model from Openrouter to generate the syntehtic Rust q-a dataset (rust_qa_dataset_5k.jsonl)

eval: contains eval_script.py for evaluating the finetuned model on rust_qa_500_bench.jsonl using a Judge LLM (Qwen 4b model)

main.py: RAG implementation with ChromaDB and Langchain

app.py: Simple frontend for User q-a built with Streamlit

Contributors

SmallChungus1

24 commits

SmallChungus1/LoRA_RAG_for_Rust

LORA-finetuned SLM + RAG for Rust-related question answering

0

stars

24

commits

Jupyter Notebook

primary language

Feb 10, 2026

updated

README

In this project I finetuned HuggingFace SLMs (Qwen 0.6B, Smollm2 135M) with Lora on 5k synthetically generated Rust Programming question-answer pairs. The model is paired with RAG (chromaDB, LangChain) to answer Rust-related questions using a Rust Programming textbook for grounding. It also contains a evaluation script that uses a Judge LLM (Qwen 4b model) to evaluate the finetuned model against baseline on rust_qa_500_bench.jsonl.

Usage:

  • create venv and install dependencies python -m venv .venv source .venv/bin/activate pip install -r requirements.txt
  • to start up the StreamLit App: streamlit run app.py
  • to run the evaluation script: python eval/eval_script.py

Repo overview:

cs_rag_llm_lora_finetune.ipynb: LORA finetuning code using HuggingFace's PEFT and TRL libs and their models. Training was done through Google Colab, using an L4 GPU.

data_gen: folder with code for calling larger Qwen model from Openrouter to generate the syntehtic Rust q-a dataset (rust_qa_dataset_5k.jsonl)

eval: contains eval_script.py for evaluating the finetuned model on rust_qa_500_bench.jsonl using a Judge LLM (Qwen 4b model)

main.py: RAG implementation with ChromaDB and Langchain

app.py: Simple frontend for User q-a built with Streamlit

Contributors

SmallChungus1

24 commits

Languages

Jupyter Notebook

87.2%

Python

12.8%