CatLLM JSON Formatter

A fine-tuned Qwen2.5-0.5B-Instruct model that converts messy LLM classification output into valid cat-llm JSON format.

Task

Given a list of numbered categories and raw (possibly malformed) classification output from another LLM, this model produces clean JSON:

{"1": "0", "2": "1", "3": "0", ...}

Usage

This model is used automatically by cat-llm when json_formatter=True:

import catllm as cat

results = cat.classify(
    input_data=df["responses"],
    categories=["Positive", "Negative", "Neutral"],
    api_key="your-key",
    json_formatter=True,  # enables the formatter fallback
)

Install the formatter dependencies: pip install cat-llm[formatter]

Training

  • Base model: Qwen/Qwen2.5-0.5B-Instruct
  • Method: LoRA (r=16, alpha=32) merged into base weights
  • Training data: 4,000 synthetic examples covering 26+ messy output formats
  • Epochs: 3
  • Metrics: 100% parse success, 98% exact match on held-out test set

Prompt Format

The model uses the Qwen chat template with:

System: JSON formatter instructions (built into cat-llm)

User:

Categories:
1. Category A
2. Category B
...

Raw classification output:
{messy output here}

Assistant: {"1":"0","2":"1",...}

Downloads last month
13
Safetensors
Model size
0.5B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for chrissoria/catllm-json-formatter

Base model

Qwen/Qwen2.5-0.5B
Finetuned
(647)
this model