Log Surgeon SLM

A specialist small language model fine-tuned for analyzing CI/CD and infrastructure logs.

Model Description

Log Surgeon SLM is a ~1.5B parameter model specialized in:

  • Identifying failure regions in logs
  • Extracting root causes
  • Classifying errors into 8 categories
  • Providing actionable fix suggestions
  • Returning structured JSON output

Supported Platforms

  • GitHub Actions
  • GitLab CI
  • Jenkins
  • ArgoCD
  • Docker
  • Dagger
  • systemd

Error Classifications

  • CONFIG_ERROR: Configuration issues
  • DEPENDENCY_ERROR: Package/dependency problems
  • NETWORK_ERROR: Network connectivity issues
  • CREDENTIALS_ERROR: Authentication failures
  • TEST_FAILURE: Test failures
  • LINT_ERROR: Code quality issues
  • INFRASTRUCTURE_ERROR: Infrastructure problems
  • TIMEOUT: Timeout errors

Usage

from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel

# Load model
base_model = "Qwen/Qwen2.5-1.5B-Instruct"
model = AutoModelForCausalLM.from_pretrained(base_model)
model = PeftModel.from_pretrained(model, "sylvester-francis/log-surgeon-slm")
tokenizer = AutoTokenizer.from_pretrained("sylvester-francis/log-surgeon-slm")

# Analyze log
log_content = """
ERROR: npm install failed
npm ERR! code ENOTFOUND
npm ERR! network request failed
"""

prompt = f"""<role>You are a senior CI/CD diagnostics assistant.</role>

<log>
{log_content}
</log>

<task>Analyze the log above. Identify the failure region, determine root cause, classify the error, and suggest fixes.</task>

<output_format>
Respond with valid JSON only.
</output_format>"""

inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=512)
result = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(result)

Training

  • Base Model: Qwen/Qwen2.5-1.5B-Instruct
  • Method: LoRA/PEFT fine-tuning
  • Data: Synthetic CI/CD logs
  • LoRA Rank: 16
  • LoRA Alpha: 32

Limitations

  • Trained on synthetic data; may not cover all real-world scenarios
  • Best performance on logs similar to training distribution
  • May hallucinate details not present in logs
  • Always verify suggested fixes before applying

Intended Use

  • DevOps automation and log analysis
  • CI/CD pipeline debugging
  • Educational purposes

License

MIT License

Citation

@software{log_surgeon_slm,
  author = {Sylvester Francis},
  title = {Log Surgeon SLM: A Specialist Model for CI/CD Log Analysis},
  year = {2025},
  url = {https://huggingface.co/sylvester-francis/log-surgeon-slm},
  note = {Fine-tuned language model for analyzing CI/CD and infrastructure logs}
}
Downloads last month
46
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for sylvester-francis/log-surgeon-slm

Base model

Qwen/Qwen2.5-1.5B
Adapter
(575)
this model