Downloads · 30 days
5
17% of all-time downloads
gyung/lfm25-ko-legal-retriever-v10-source-repair-lora
lfm25-ko-legal-retriever-v10-source-repair-lora is a machine learning model from gyung. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as other.
This is a LoRA adapter for LiquidAI/LFM2.5-8B-A1B.
Downloads · 30 days
5
17% of all-time downloads
All-time downloads
30
Public
Repo size
69.4 MB
Likes
0
Public
Click a slice to open those files.
.safetensors51.5 MB · 74%
From the Hugging Face model README
This is a LoRA adapter for LiquidAI/LFM2.5-8B-A1B.
It is trained for Korean legal retrieval tool use, not for legal answer generation. The model reads a legal query and emits JSON tool actions such as fan_out_search, review_docs, curate, verify, and end_search.
doc_id values for a downstream LLM.Do not use this adapter as a standalone legal advice model.
Source-rag1200 post-hoc/regression evaluation:
| metric | value |
|---|---|
| count | 1200 |
| recall | 0.67917 |
| precision | 0.53042 |
| F2 | 0.58451 |
| trajectory_recall | 0.98583 |
| valid_action_rate | 0.82119 |
| ended | 0.56167 |
This is not a clean hidden benchmark because the source-rag data was used in repair training. Treat it as regression/post-hoc repair evidence.
Install:
pip install -U "huggingface_hub[cli]" peft transformers vllm
Download the LoRA adapter:
hf download gyung/lfm25-ko-legal-retriever-v10-source-repair-lora \
--local-dir lfm25-ko-legal-retriever-v10-source-repair-lora
Serve the base model with this adapter:
python -m vllm.entrypoints.openai.api_server \
--model LiquidAI/LFM2.5-8B-A1B \
--enable-lora \
--lora-modules lfm25-ko-legal-retriever-v10=./lfm25-ko-legal-retriever-v10-source-repair-lora \
--served-model-name lfm25-ko-legal-retriever-v10 \
--max-model-len 12288 \
--gpu-memory-utilization 0.92
Request:
curl http://127.0.0.1:8000/v1/chat/completions \
-H 'Content-Type: application/json' \
-d '{
"model": "lfm25-ko-legal-retriever-v10",
"messages": [
{"role": "system", "content": "assistant 응답은 항상 JSON action 하나만 출력합니다. 허용 tool: fan_out_search, review_docs, curate, verify, end_search."},
{"role": "user", "content": "민법 제126조 표현대리와 관련 판례 근거 문서를 찾아라."}
],
"temperature": 0.1,
"max_tokens": 192
}'
Expected style:
{"tool":"fan_out_search","queries":["민법 제126조 표현대리","표현대리 정당한 이유 판례","무권대리 표현대리 대법원"]}
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base_id = "LiquidAI/LFM2.5-8B-A1B"
adapter_id = "gyung/lfm25-ko-legal-retriever-v10-source-repair-lora"
tokenizer = AutoTokenizer.from_pretrained(base_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
base_id,
device_map="auto",
torch_dtype="auto",
trust_remote_code=True,
)
model = PeftModel.from_pretrained(model, adapter_id)
messages = [
{
"role": "system",
"content": "assistant 응답은 항상 JSON action 하나만 출력합니다. 허용 tool: fan_out_search, review_docs, curate, verify, end_search.",
},
{"role": "user", "content": "민법 제126조 표현대리와 관련 판례 근거 문서를 찾아라."},
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=192, do_sample=False)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
Local training/eval artifacts are indexed in harness-1/README.md and harness-1/artifacts/README.md.