๐Ÿ“ Document Distiller

SLM Summarizer

Local CPU text distillation engine that compresses long-form documents, articles, and financial notes into structured bullet highlights.

๐Ÿš€ Overview & Capabilities

Local CPU text distillation engine that compresses long-form documents, articles, and financial notes into structured bullet highlights.

Key Features

  • Sub-billion parameter local distillation model
  • High compression ratio with zero factual hallucinations
  • Support for multi-paragraph document inputs
  • Sub-200ms latency on standard CPUs

๐Ÿ’ป Installation

Install the local package using pip:

Terminal
$pip install slm-summarizer

๐Ÿ™ Checkout from GitHub

Clone only this agent's folder from the monorepo using Git sparse-checkout โ€” no need to download the full repository:

Option 1 โ€” Sparse Checkout (Recommended)

Terminal โ€” Git Sparse Checkout
# 1. Create and enter a new directory
$ mkdir slm_summarizer && cd slm_summarizer

# 2. Initialise empty git repo and add remote
$ git init
$ git remote add origin https://github.com/t00114218-stack/SLMAgents.git

# 3. Enable sparse-checkout and set target folder
$ git sparse-checkout init --cone
$ git sparse-checkout set slm_summarizer

# 4. Pull only that agent's source
$ git pull origin main

Option 2 โ€” Full Repository Clone

Terminal โ€” Full Clone
$ git clone https://github.com/t00114218-stack/SLMAgents.git
$ cd SLMAgents/slm_summarizer

๐Ÿ’ก Tip: After checkout, install the package locally with pip install -e ./slm_summarizer to run in editable mode without publishing to PyPI.

โš™๏ธ Configuration API

Constructor Parameters

Instantiate SLMSummarizer with performance and runtime options:

ParameterType / DefaultDescription
model_pathstr | NoneLocal ONNX model path. Default: None.
temperaturefloat | 0.3Sampling temperature. Default: 0.3.
top_pfloat | 0.9Nucleus sampling threshold. Default: 0.9.
max_tokensint | 512Max token output limit. Default: 512.
n_threadsint | 4CPU threads for inference. Default: 4.

Methods

Method SignatureReturn TypeDescription
summarize(text, ...)strGenerates concise summary highlights from raw text documents.

Execution Parameters

Complete list of execution parameters accepted by the primary agent method:

ParameterType / DefaultDescription
textstrRaw text content string to summarize.
system_promptstr | NoneInstruction defining target summary format. Default: None.
user_inputstr | NoneAdditional topic focus constraints. Default: None.
temperaturefloat | 0.3Sampling temperature. Default: 0.3.
top_pfloat | 0.9Nucleus sampling probability. Default: 0.9.
max_tokensint | 512Maximum output token limit. Default: 512.

Quick Start

Python Example
from slm_summarizer import SLMSummarizer

summarizer = SLMSummarizer(temperature=0.3, top_p=0.9, max_tokens=512)
summary = summarizer.summarize(
    text="Q3 net revenue reached $1.25M (+15% YoY). Operating margins expanded to 34% due to hardware optimization.",
    system_prompt="Limit summary to concise bullet points",
    user_input="Focus on revenue and margins",
    temperature=0.3,
    top_p=0.9,
    max_tokens=512
)
print(summary)

๐Ÿ” Verified Output Logs

Diagnostic execution console output running locally on CPU:

Output Console
โ†’ INPUT:
Text: Q3 net revenue reached $1.25M (+15% YoY)...

โ† OUTPUT:
โ€ข Q3 net revenue grew +15% YoY to $1.25M
โ€ข Operating margins expanded to 34% via local optimization