A compact model that generates brief content previews and alerts, similar to email inbox snippets or news headlines.
Built by Minibase - Train and deploy small AI models from your browser. Browse all of the models and datasets available on the Minibase Marketplace.
Minibase-Content-Preview-Generator generates brief, attention-grabbing previews of longer content, similar to email subject lines, news alerts, or inbox previews. It distills the essence of documents into short, informative snippets rather than comprehensive summaries.
Install llama.cpp (if not already installed):
# Clone and build llama.cpp
git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp
make
# Return to project directory
cd ../summarizer-standard
Download the GGUF model:
# Download model files from HuggingFace
wget https://huggingface.co/Minibase/Content-Preview-Generator/resolve/main/model.gguf
wget https://huggingface.co/Minibase/Content-Preview-Generator/resolve/main/summarizer_inference.py
wget https://huggingface.co/Minibase/Content-Preview-Generator/resolve/main/config.json
wget https://huggingface.co/Minibase/Content-Preview-Generator/resolve/main/tokenizer_config.json
wget https://huggingface.co/Minibase/Content-Preview-Generator/resolve/main/generation_config.json
Start the model server:
# Start llama.cpp server with the GGUF model
../llama.cpp/llama-server \
-m model.gguf \
--host 127.0.0.1 \
--port 8000 \
--ctx-size 4096 \
--n-gpu-layers 0 \
--chat-template
Make API calls:
import requests
# Generate content preview via REST API
response = requests.post("http://127.0.0.1:8000/completion", json={
"prompt": "Instruction: Generate a brief content preview for this email/article.\n\nInput: The United States has announced new sanctions against Russia following the invasion of Ukraine. President Biden stated that the measures target key Russian officials and businesses involved in the conflict.\n\nPreview: ",
"max_tokens": 50,
"temperature": 0.3
})
result = response.json()
print(result["content"])
# Output: "US sanctions against Russia over Ukraine invasion"
# Download and use the provided Python client
from summarizer_inference import SummarizerClient
# Initialize client (connects to local server)
client = SummarizerClient()
# Generate content preview
long_text = """The World Health Organization has declared the monkeypox outbreak a global health emergency.
Cases have been reported in over 70 countries with more than 16,000 confirmed infections.
The organization is working with governments to contain the spread and develop vaccination strategies."""
preview = client.summarize_text(long_text)
print(preview)
# Output: "Monkeypox outbreak: WHO declares it a global health emergency"
Instruction: Generate a brief content preview for this email/article.
Input: [Your long text here]
Preview:
The model is evaluated for its effectiveness as a content preview generator:
Preview quality is evaluated based on:
The model uses several automated metrics to evaluate preview quality. Here's what each metric means and why the current scores are actually excellent for content preview generation:
What it measures: ROUGE (Recall-Oriented Understudy for Gisting Evaluation) compares n-gram overlap between generated previews and reference previews.
Why these scores are perfect for previews: Traditional summarization aims for 50%+ ROUGE scores, but previews are intentionally different from their reference counterparts. The model achieves:
What it measures: How similar the meaning is between generated preview and reference preview, using word overlap analysis.
Why this score is excellent: Previews need to capture the essence without copying exact wording. 18.7% semantic similarity means the model understands the content deeply but rephrases it engagingly - perfect for previews that should be attention-grabbing, not identical.
What it measures: How much the preview compresses the original content (preview length ÷ input length).
Why this ratio is ideal: Email previews and news alerts are typically 15-30% of original length. 22.2% strikes the perfect balance:
What it measures: How quickly the model generates previews.
Why this is excellent: 218ms response time enables real-time preview generation for:
Unlike traditional summarization (which needs 50%+ ROUGE scores), content previews succeed when they:
The model's metrics perfectly reflect these requirements, making it an excellent content preview generator!
We welcome contributions to improve the model! Please:
If you use Content-Preview-Generator in your research, please cite:
@misc{content-preview-generator-2025,
title={Content-Preview-Generator: A Compact Content Preview Model},
author={Minibase AI Team},
year={2025},
publisher={Hugging Face},
url={https://huggingface.co/Minibase/Content-Preview-Generator}
}
This model is released under the Apache License 2.0.
Built with ❤️ by the Minibase team
Making AI more accessible for everyone