pkmodel-mistral-layout-merged

Fine-tuned version of Mistral-7B-Instruct-v0.2 trained to generate structured slide layout JSON from natural language prompts.

What it does

Give it a prompt like:

"Create a 5-slide pitch deck for a SaaS startup with dark blue and orange colors"

It returns a structured JSON object describing the full deck layout β€” titles, slide types, color themes, element positions β€” ready to pass into a python-pptx rendering pipeline to produce an editable .pptx file.

Training

  • Base model: Mistral-7B-Instruct-v0.2
  • Method: QLoRA (4-bit) β†’ merged to full BF16
  • Dataset: SlideModel template library metadata (titles, descriptions, tags, categories, colors, layouts)
  • Hardware: A100 40GB (Google Colab Pro)
  • Epochs: 3

Usage

from transformers import AutoTokenizer, AutoModelForCausalLM
import torch, json

model_id = "mindfossil/pkmodel-mistral-layout-merged"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id, dtype=torch.bfloat16, device_map="auto"
)

SYSTEM = """You are pkmodel, an expert presentation designer.
Given a user request, output a valid JSON object describing the slide deck layout.
Output only valid JSON. No explanation, no markdown fences."""

prompt = f"<s>[INST] <<SYS>>\n{SYSTEM}\n<</SYS>>\n\nCreate a 3-slide overview deck for a fintech product. [/INST]"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)

with torch.no_grad():
    out = model.generate(**inputs, max_new_tokens=800, temperature=0.7, do_sample=True)

response = tokenizer.decode(out[0], skip_special_tokens=True)
layout = json.loads(response.split("[/INST]")[-1].strip())
print(json.dumps(layout, indent=2))

Part of the pkmodel pipeline

This model is the layout brain in a two-model pipeline:

  1. This model β€” prompt β†’ slide layout JSON
  2. FLUX.1 LoRA (mindfossil/pkmodel-flux-lora, coming soon) β€” visual style generation
  3. python-pptx renderer β€” JSON β†’ editable .pptx
Downloads last month
-
Safetensors
Model size
7B params
Tensor type
BF16
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for mindfossil/pkmodel-mistral-layout-merged

Adapter
(1201)
this model