Actual LogSage training metrics chart

Presentation companion · real project artifacts

How a 7B model learned to diagnose application logs.

LogSage is a QLoRA adapter built on Qwen2.5-7B-Instruct. It turns raw application logs into a structured first-pass diagnosis with an issue, likely root cause, severity, fix, and confidence.

Actual run · 378 steps · QLoRA on AWS NVIDIA A10G
011,116structured training examples
027BQwen2.5 instruction base
0334.3mAWS training runtime
040.789best eval loss at step 250
The complete story

Dataset contract → QLoRA training → adapter publishing → Colab inference.

This page follows the same sequence used in the video. Every number and link comes from the repository, training report, or published Hugging Face adapter.

01

Dataset

Teach a stable response contract.

Each row pairs raw logs and an instruction with a structured output containing issue, root_cause, severity, fix, and confidence.

1,116validated rows
02

Formatting

Turn every example into a Qwen conversation.

The project uses ChatML-style system, user, and assistant turns. Training and inference use the same conversation structure.

5required output fields
03

QLoRA

Freeze the quantized base and train small adapter weights.

The 7B base model is loaded in 4-bit form. LoRA rank 16 adapters capture task-specific updates while the original model remains separate.

r=16LoRA rank
04

AWS training

Run the real job on one NVIDIA A10G.

The run used an AWS EC2 g5.2xlarge, three epochs, 378 steps, checkpointing, TensorBoard, JSONL metrics, and evaluation outputs.

34.3mtraining runtime
05

Publishing

Push the adapter to Hugging Face.

The published repository stores the task-specific adapter and metadata. Inference still needs the compatible Qwen base model.

PEFTportable adapter
06

Inference

Load everything in a fresh Google Colab runtime.

Install dependencies, load the tokenizer and 4-bit base, attach the adapter, apply the chat template, generate, decode only new tokens, then extract and validate JSON.

Colabreproducible demo

The actual training run

The model improved, then the evaluation signal flattened.

Training loss alone is not proof of usefulness. The best evaluation loss was 0.789 at step 250; the final evaluation loss was 0.811.

LogSage training metrics
Base: unsloth/Qwen2.5-7B-Instruct-bnb-4bit · QLoRA rank 16, alpha 16 · 1,004 train / 112 eval · 3 epochs.
GPUNVIDIA A10G
Instanceg5.2xlarge
Total steps378
Best eval loss0.789

The only live build in the video

Fresh Colab runtime, base model, adapter, structured output.

LogSage_Inference_Colab.ipynb
# 1. Load tokenizer + 4-bit Qwen base
base = AutoModelForCausalLM.from_pretrained(...)

# 2. Attach published LogSage adapter
model = PeftModel.from_pretrained(base, adapter_id)

# 3. Reuse the training chat structure
prompt = tokenizer.apply_chat_template(messages, ...)

# 4. Generate only the diagnosis
outputs = model.generate(...)
answer = outputs[0][input_length:]

# 5. Decode and validate structured JSON
result = extract_json(tokenizer.decode(answer))

What viewers should understand

The tokenizer applies the conversation format. The base model supplies general language capability. The PEFT adapter supplies LogSage's learned task behavior.

Input
Raw application logs and incident context
Output
Issue, root cause, severity, fix, confidence
Runtime
Google Colab GPU with 4-bit loading
Open the inference notebook ↗

Video sequence

Present the system, do not perform repository tourism.

  • Hook: raw logs to structured diagnosis
  • Dataset: one row, fixed schema, validation
  • QLoRA: frozen 4-bit base plus trainable adapter
  • Training: AWS setup, key code, actual metrics
  • Publishing: what the Hugging Face adapter contains
  • Inference: fresh Colab runtime and three test cases
  • Debrief: limitations and next evaluation work

The honest boundary

A focused experiment, not an incident authority.

LogSage may hallucinate root causes, miss cross-service context, mishandle unseen formats, or sound more certain than the evidence supports.

Stronger evaluation still needs held-out cases, JSON-validity rate, base-model comparison, latency measurement, hallucination analysis, and confidence calibration.

For the peeps building for real

The adapter is small. The engineering lifecycle is the lesson.

LogSage demonstrates the path from a structured dataset to QLoRA training on AWS, observable metrics, a published PEFT adapter, and reproducible inference in Colab.