Instructions to use mateo-19182/forocoches-lm-v3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mateo-19182/forocoches-lm-v3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mateo-19182/forocoches-lm-v3")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("mateo-19182/forocoches-lm-v3") model = AutoModelForCausalLM.from_pretrained("mateo-19182/forocoches-lm-v3", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mateo-19182/forocoches-lm-v3 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mateo-19182/forocoches-lm-v3" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mateo-19182/forocoches-lm-v3", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/mateo-19182/forocoches-lm-v3
- SGLang
How to use mateo-19182/forocoches-lm-v3 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "mateo-19182/forocoches-lm-v3" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mateo-19182/forocoches-lm-v3", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "mateo-19182/forocoches-lm-v3" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mateo-19182/forocoches-lm-v3", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use mateo-19182/forocoches-lm-v3 with Docker Model Runner:
docker model run hf.co/mateo-19182/forocoches-lm-v3
forocoches-lm v3
Gemma 3 1B (pretrained) fully fine-tuned to write Spanish forum threads in the style of ForoCoches: title, opening post and replies, conditioned on a thread type and a year. Demo at forocoches.m19182.dev (runs in the browser with the q4f16_1 MLC weights).
v3 continues from v2 on forocoches-threads-v3, which adds long stories and threads from 2003–2026. Compared with v2 it writes long opening posts that stay coherent, with paragraphs, edits and a closing summary, instead of drifting into run-on text.
Prompt format
Plain text. Optional header line, then the title, then posts separated by blank lines. Authors are pseudonymised (OP, forero_a, forero_b, ...). Quotes are [cita=forero_a]...[/cita].
tipo: historia | año: 2024
TÍTULO: Lo que me ha pasado hoy en el Mercadona +tocho
#1 OP: Bueno shurs, ayer por la tarde...
#2 forero_a: ...
The header takes tipo (historia, pregunta, debate, humor, hipotetico) and año (2003–2026), in that order. Each field was dropped half of the time in training, so either can be left out, as can the whole header.
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("mateo-19182/forocoches-lm-v3")
model = AutoModelForCausalLM.from_pretrained("mateo-19182/forocoches-lm-v3", dtype="bfloat16", device_map="auto")
ids = tok("tipo: pregunta | año: 2008\n\nTÍTULO:", return_tensors="pt").to(model.device)
out = model.generate(**ids, max_new_tokens=400, do_sample=True, temperature=0.8, top_p=0.95, repetition_penalty=1.1)
print(tok.decode(out[0], skip_special_tokens=True))
Training
- Init: forocoches-lm v2 (itself ~496M tokens on the 2019–2020 archive).
- Data: 545.5M completion tokens, one epoch, from forocoches-threads-v3:
- stories ×2: 280M;
- October 2026 crawl threads: 120M;
- a 90M sample of the archive threads;
- 56M general-Spanish replay from FineWeb-2 (
spa_Latn).
- Long threads are split into 8,192-token chunks with 256 tokens of masked context.
- Thread types and quality were labelled with Claude Haiku. Only
media/altaquality threads of the five types above are kept. - Year of the opening post: archive years are estimated from the nearest crawled thread ID.
- Full fine-tune with Unsloth + TRL + FlexAttention on one RTX 5090:
- packed 8,192-token rows, 8 per step (65,536 tokens/step), 8,396 steps;
- lr 2e-5 cosine with 3% warmup, weight decay 0.01;
- bf16 compute with fp32 master weights;
- completion-only loss: the header conditions and is not predicted.
- 8 h.
- Final eval loss 2.168 on the v3 validation set, which has longer stories than v2's.
Evaluation
Completion perplexity on 4,873 held-out threads (the same set for every version), lower is better.
| base | v1 | v2 | v3 | |
|---|---|---|---|---|
| all forum text | 11.11 | 7.08 | 6.81 | 6.54 |
| historia | 11.88 | 7.87 | 7.63 | 7.17 |
| humor | 12.53 | 6.60 | 6.40 | 6.25 |
| debate | 11.42 | 7.24 | 7.01 | 6.77 |
| pregunta | 10.58 | 6.95 | 6.65 | 6.36 |
| general Spanish (control) | 13.19 | 12.82 | 13.03 | 10.68 |
On v3's own validation set (3,280 threads with more long stories), v3 vs v2:
- historia: 12.31 → 10.46
- all: 9.90 → 8.78
Limitations
Hobby/research artefact. It writes forum text, including the rude, sexist and otherwise offensive parts of the source, and states made-up facts confidently. Opening posts tagged as stories sometimes turn into encyclopedic articles. Authors are pseudonymised and usernames of five or more characters masked; shorter ones and a few @@nick forms survived. Spanish from Spain.
Weights are bf16 (2 GB). Base model terms: Gemma Terms of Use.
- Downloads last month
- 21