Instructions to use NightBaRron1412/deepparse-r1-8b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use NightBaRron1412/deepparse-r1-8b with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("deepseek-ai/DeepSeek-R1-Distill-Llama-8B") model = PeftModel.from_pretrained(base_model, "NightBaRron1412/deepparse-r1-8b") - Notebooks
- Google Colab
- Kaggle
Add DeepParse v1.0.0 LoRA adapter (DeepSeek-R1-Distill-Llama-8B)
Browse files- .gitattributes +1 -0
- README.md +113 -0
- adapter_config.json +48 -0
- adapter_model.safetensors +3 -0
- chat_template.jinja +1 -0
- deepparse_finetune_config.json +28 -0
- tokenizer.json +3 -0
- tokenizer_config.json +14 -0
- training_args.bin +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: deepseek-ai/DeepSeek-R1-Distill-Llama-8B
|
| 3 |
+
library_name: peft
|
| 4 |
+
pipeline_tag: text-generation
|
| 5 |
+
license: apache-2.0
|
| 6 |
+
tags:
|
| 7 |
+
- lora
|
| 8 |
+
- peft
|
| 9 |
+
- log-parsing
|
| 10 |
+
- regex-synthesis
|
| 11 |
+
- deepparse
|
| 12 |
+
- base_model:adapter:deepseek-ai/DeepSeek-R1-Distill-Llama-8B
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# DeepParse — DeepSeek-R1-Distill-Llama-8B LoRA Adapter
|
| 16 |
+
|
| 17 |
+
LoRA adapter for [DeepParse](https://github.com/NightBaRron1412/DeepParse), the hybrid log-parsing system from the EASE 2026 paper *"DeepParse: Hybrid Log Parsing with LLM-Synthesized Regex Masks."*
|
| 18 |
+
|
| 19 |
+
The adapter fine-tunes `deepseek-ai/DeepSeek-R1-Distill-Llama-8B` to emit a small JSON bundle of **labelled regex masks** when shown a sample of raw log lines. Those masks are consumed by the deterministic Drain stage at execution time — the LLM is invoked **once at installation**, never per log line.
|
| 20 |
+
|
| 21 |
+
## Quick start
|
| 22 |
+
|
| 23 |
+
### Via the DeepParse CLI
|
| 24 |
+
|
| 25 |
+
```bash
|
| 26 |
+
pip install deepparse
|
| 27 |
+
export HF_TOKEN=<your-token> # base model is gated
|
| 28 |
+
|
| 29 |
+
deepparse synth \
|
| 30 |
+
--mode hf \
|
| 31 |
+
--adapter NightBaRron1412/deepparse-r1-8b \
|
| 32 |
+
--input partner_logs.txt \
|
| 33 |
+
--out masks.json
|
| 34 |
+
|
| 35 |
+
deepparse parse --masks masks.json --input partner_logs.txt --out parsed.csv
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
### Via the Python API
|
| 39 |
+
|
| 40 |
+
```python
|
| 41 |
+
from deepparse import synth_masks, Drain
|
| 42 |
+
|
| 43 |
+
with open("partner_logs.txt") as f:
|
| 44 |
+
logs = f.read().splitlines()
|
| 45 |
+
|
| 46 |
+
patterns = synth_masks(
|
| 47 |
+
logs,
|
| 48 |
+
mode="hf",
|
| 49 |
+
adapter_path="NightBaRron1412/deepparse-r1-8b",
|
| 50 |
+
)
|
| 51 |
+
|
| 52 |
+
drain = Drain()
|
| 53 |
+
drain.load_masks(patterns)
|
| 54 |
+
parsed = drain.parse_all(logs)
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
## Hardware requirements
|
| 58 |
+
|
| 59 |
+
The adapter itself is ~80 MB, but it must be loaded on top of the 8 B base model:
|
| 60 |
+
|
| 61 |
+
| Precision | VRAM (base) | Notes |
|
| 62 |
+
|---|---|---|
|
| 63 |
+
| bf16 | ~16 GB | Recommended; matches training recipe |
|
| 64 |
+
| fp32 | ~32 GB | Default in the DeepParse CLI; opt-in bf16 via `--bf16` |
|
| 65 |
+
| 4-bit | ~5 GB | Requires bitsandbytes; not wired into DeepParse CLI yet |
|
| 66 |
+
|
| 67 |
+
The base model (`deepseek-ai/DeepSeek-R1-Distill-Llama-8B`) is **gated on HuggingFace** — request access on the [model page](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Llama-8B) and set `HF_TOKEN` before first use.
|
| 68 |
+
|
| 69 |
+
## Training details
|
| 70 |
+
|
| 71 |
+
| Hyperparameter | Value |
|
| 72 |
+
|---|---|
|
| 73 |
+
| Base model | `deepseek-ai/DeepSeek-R1-Distill-Llama-8B` |
|
| 74 |
+
| LoRA rank / alpha / dropout | 8 / 32 / 0.01 |
|
| 75 |
+
| Optimiser | AdamW, lr=2e-4 (cosine decay) |
|
| 76 |
+
| Batch size / grad accum | 8 / 4 |
|
| 77 |
+
| Epochs | 25 |
|
| 78 |
+
| Precision | bfloat16 |
|
| 79 |
+
| Attention | eager (AMD ROCm cross-vendor stability) |
|
| 80 |
+
| Max sequence length | 512 |
|
| 81 |
+
| Training set | 619 paper-curated examples |
|
| 82 |
+
| Hardware | AMD MI300A (ROCm 7.3) |
|
| 83 |
+
|
| 84 |
+
Hyperparameters match the paper, Section *"LLM Configuration and Fine-Tuning."*
|
| 85 |
+
|
| 86 |
+
## Intended use & limitations
|
| 87 |
+
|
| 88 |
+
**In scope.** Synthesising regex masks for the canonical variable classes covered by DeepParse (timestamps, IPs, MAC addresses, numerics, hex IDs, log levels, paths). The LLM is invoked once per log corpus at installation time; runtime parsing is fully deterministic.
|
| 89 |
+
|
| 90 |
+
**Out of scope.** Direct conversational use, code generation, anything outside the DeepParse pipeline. The model is fine-tuned to respond in a specific JSON schema and will not behave as a general-purpose assistant.
|
| 91 |
+
|
| 92 |
+
**Limitations.** Quality on log formats with unusual or domain-specific variable classes (custom IDs, vendor-specific tokens) may be lower than on the LogHub-style corpora the paper evaluates against. For those cases, consider DeepParse's offline stub mode (`--mode offline`) as a deterministic baseline or fine-tune further on a representative sample.
|
| 93 |
+
|
| 94 |
+
## Reproducibility
|
| 95 |
+
|
| 96 |
+
- **Source repo:** https://github.com/NightBaRron1412/DeepParse
|
| 97 |
+
- **Tagged release:** [v1.0.0](https://github.com/NightBaRron1412/DeepParse/releases/tag/v1.0.0)
|
| 98 |
+
- **Training script:** `python -m deepparse.training.finetune --train artifacts/training/train_paper.jsonl --output-dir artifacts/checkpoints/deepparse-r1-8b --epochs 25 --bf16`
|
| 99 |
+
|
| 100 |
+
## Citation
|
| 101 |
+
|
| 102 |
+
```bibtex
|
| 103 |
+
@inproceedings{deepparse2026,
|
| 104 |
+
title = {DeepParse: Hybrid Log Parsing with LLM-Synthesized Regex Masks},
|
| 105 |
+
author = {Shetaia, Amir and Ratkov, Mihailo and Kauffman, Sean},
|
| 106 |
+
booktitle = {Proceedings of EASE 2026},
|
| 107 |
+
year = {2026}
|
| 108 |
+
}
|
| 109 |
+
```
|
| 110 |
+
|
| 111 |
+
## License
|
| 112 |
+
|
| 113 |
+
Apache 2.0, matching the DeepParse source repository. The base model retains its own licence (DeepSeek model licence); please review before redistribution.
|
adapter_config.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alora_invocation_tokens": null,
|
| 3 |
+
"alpha_pattern": {},
|
| 4 |
+
"arrow_config": null,
|
| 5 |
+
"auto_mapping": null,
|
| 6 |
+
"base_model_name_or_path": "deepseek-ai/DeepSeek-R1-Distill-Llama-8B",
|
| 7 |
+
"bias": "none",
|
| 8 |
+
"corda_config": null,
|
| 9 |
+
"ensure_weight_tying": false,
|
| 10 |
+
"eva_config": null,
|
| 11 |
+
"exclude_modules": null,
|
| 12 |
+
"fan_in_fan_out": false,
|
| 13 |
+
"inference_mode": true,
|
| 14 |
+
"init_lora_weights": true,
|
| 15 |
+
"layer_replication": null,
|
| 16 |
+
"layers_pattern": null,
|
| 17 |
+
"layers_to_transform": null,
|
| 18 |
+
"loftq_config": {},
|
| 19 |
+
"lora_alpha": 32,
|
| 20 |
+
"lora_bias": false,
|
| 21 |
+
"lora_dropout": 0.01,
|
| 22 |
+
"lora_ga_config": null,
|
| 23 |
+
"megatron_config": null,
|
| 24 |
+
"megatron_core": "megatron.core",
|
| 25 |
+
"modules_to_save": null,
|
| 26 |
+
"peft_type": "LORA",
|
| 27 |
+
"peft_version": "0.19.1",
|
| 28 |
+
"qalora_group_size": 16,
|
| 29 |
+
"r": 8,
|
| 30 |
+
"rank_pattern": {},
|
| 31 |
+
"revision": null,
|
| 32 |
+
"target_modules": [
|
| 33 |
+
"k_proj",
|
| 34 |
+
"o_proj",
|
| 35 |
+
"q_proj",
|
| 36 |
+
"v_proj",
|
| 37 |
+
"gate_proj",
|
| 38 |
+
"up_proj",
|
| 39 |
+
"down_proj"
|
| 40 |
+
],
|
| 41 |
+
"target_parameters": null,
|
| 42 |
+
"task_type": "CAUSAL_LM",
|
| 43 |
+
"trainable_token_indices": null,
|
| 44 |
+
"use_bdlora": null,
|
| 45 |
+
"use_dora": false,
|
| 46 |
+
"use_qalora": false,
|
| 47 |
+
"use_rslora": false
|
| 48 |
+
}
|
adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:57f194c5659a10ad096077f06cbbe53a496370711082fab63479bbca64ca744f
|
| 3 |
+
size 83945296
|
chat_template.jinja
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% set ns = namespace(is_first=false, is_tool=false, is_output_first=true, system_prompt='') %}{%- for message in messages %}{%- if message['role'] == 'system' %}{% set ns.system_prompt = message['content'] %}{%- endif %}{%- endfor %}{{bos_token}}{{ns.system_prompt}}{%- for message in messages %}{%- if message['role'] == 'user' %}{%- set ns.is_tool = false -%}{{'<|User|>' + message['content']}}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is none %}{%- set ns.is_tool = false -%}{%- for tool in message['tool_calls']%}{%- if not ns.is_first %}{{'<|Assistant|><|tool▁calls▁begin|><|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\n' + '```json' + '\n' + tool['function']['arguments'] + '\n' + '```' + '<|tool▁call▁end|>'}}{%- set ns.is_first = true -%}{%- else %}{{'\n' + '<|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\n' + '```json' + '\n' + tool['function']['arguments'] + '\n' + '```' + '<|tool▁call▁end|>'}}{{'<|tool▁calls▁end|><|end▁of▁sentence|>'}}{%- endif %}{%- endfor %}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is not none %}{%- if ns.is_tool %}{{'<|tool▁outputs▁end|>' + message['content'] + '<|end▁of▁sentence|>'}}{%- set ns.is_tool = false -%}{%- else %}{% set content = message['content'] %}{% if '</think>' in content %}{% set content = content.split('</think>')[-1] %}{% endif %}{{'<|Assistant|>' + content + '<|end▁of▁sentence|>'}}{%- endif %}{%- endif %}{%- if message['role'] == 'tool' %}{%- set ns.is_tool = true -%}{%- if ns.is_output_first %}{{'<|tool▁outputs▁begin|><|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- set ns.is_output_first = false %}{%- else %}{{'\n<|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- endif %}{%- endif %}{%- endfor -%}{% if ns.is_tool %}{{'<|tool▁outputs▁end|>'}}{% endif %}{% if add_generation_prompt and not ns.is_tool %}{{'<|Assistant|><think>\n'}}{% endif %}
|
deepparse_finetune_config.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"train_file": "artifacts/training/train_paper.jsonl",
|
| 3 |
+
"output_dir": "artifacts/checkpoints/deepparse-r1-8b",
|
| 4 |
+
"model_name": "deepseek-ai/DeepSeek-R1-Distill-Llama-8B",
|
| 5 |
+
"epochs": 25,
|
| 6 |
+
"learning_rate": 0.0002,
|
| 7 |
+
"batch_size": 8,
|
| 8 |
+
"grad_accum": 4,
|
| 9 |
+
"lora_rank": 8,
|
| 10 |
+
"lora_alpha": 32,
|
| 11 |
+
"lora_dropout": 0.01,
|
| 12 |
+
"max_length": 512,
|
| 13 |
+
"bf16": false,
|
| 14 |
+
"attn_implementation": "eager",
|
| 15 |
+
"seed": 1337,
|
| 16 |
+
"eval_split": 0.0,
|
| 17 |
+
"save_steps": 200,
|
| 18 |
+
"log_steps": 25,
|
| 19 |
+
"target_modules": [
|
| 20 |
+
"q_proj",
|
| 21 |
+
"k_proj",
|
| 22 |
+
"v_proj",
|
| 23 |
+
"o_proj",
|
| 24 |
+
"gate_proj",
|
| 25 |
+
"up_proj",
|
| 26 |
+
"down_proj"
|
| 27 |
+
]
|
| 28 |
+
}
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e05415a77450961019a0e3db91ef50d226ad847379359b3f43d8d439a110cb6e
|
| 3 |
+
size 17208729
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": null,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": "<|begin▁of▁sentence|>",
|
| 5 |
+
"clean_up_tokenization_spaces": false,
|
| 6 |
+
"eos_token": "<|end▁of▁sentence|>",
|
| 7 |
+
"is_local": false,
|
| 8 |
+
"model_max_length": 16384,
|
| 9 |
+
"pad_token": "<|end▁of▁sentence|>",
|
| 10 |
+
"sp_model_kwargs": {},
|
| 11 |
+
"tokenizer_class": "LlamaTokenizer",
|
| 12 |
+
"unk_token": null,
|
| 13 |
+
"use_default_system_prompt": false
|
| 14 |
+
}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5de392820a372291ca7846c4a05f5ff271f9602166cc5aeb2afd5b76505d04e7
|
| 3 |
+
size 4792
|