Text Classification
ONNX
Safetensors
GGUF
English
text-segmentation
entity-linking
quotation-attribution
multiple-choice
question-answering
summarization
modernbert
conversational
Instructions to use freeideas/UsefulLocalModels with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use freeideas/UsefulLocalModels with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf freeideas/UsefulLocalModels:Q4_K_M # Run inference directly in the terminal: llama cli -hf freeideas/UsefulLocalModels:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf freeideas/UsefulLocalModels:Q4_K_M # Run inference directly in the terminal: llama cli -hf freeideas/UsefulLocalModels:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf freeideas/UsefulLocalModels:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf freeideas/UsefulLocalModels:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf freeideas/UsefulLocalModels:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf freeideas/UsefulLocalModels:Q4_K_M
Use Docker
docker model run hf.co/freeideas/UsefulLocalModels:Q4_K_M
- Llama new
- LM Studio
- Jan
- Ollama
How to use freeideas/UsefulLocalModels with Ollama:
ollama run hf.co/freeideas/UsefulLocalModels:Q4_K_M
- Unsloth Desktop
- Pi
How to use freeideas/UsefulLocalModels with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf freeideas/UsefulLocalModels:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "freeideas/UsefulLocalModels:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use freeideas/UsefulLocalModels with Docker Model Runner:
docker model run hf.co/freeideas/UsefulLocalModels:Q4_K_M
- Lemonade
How to use freeideas/UsefulLocalModels with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull freeideas/UsefulLocalModels:Q4_K_M
Run and chat with the model
lemonade run user.UsefulLocalModels-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use freeideas/UsefulLocalModels with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf freeideas/UsefulLocalModels:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default freeideas/UsefulLocalModels:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use freeideas/UsefulLocalModels with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf freeideas/UsefulLocalModels:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "freeideas/UsefulLocalModels:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Model card
Browse files
README.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language: en
|
| 4 |
+
tags:
|
| 5 |
+
- text-classification
|
| 6 |
+
- text-segmentation
|
| 7 |
+
- summarization
|
| 8 |
+
- onnx
|
| 9 |
+
- modernbert
|
| 10 |
+
base_model: Alibaba-NLP/gte-reranker-modernbert-base
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# Useful local models
|
| 14 |
+
|
| 15 |
+
Small models that run on an ordinary CPU and take frequent, repetitive work away from large language models: cheaper, faster, and private, because the text never leaves the machine.
|
| 16 |
+
|
| 17 |
+
| Folder | What it does | Size |
|
| 18 |
+
|---|---|---|
|
| 19 |
+
| [`same-subject-r2/`](same-subject-r2/) | Says whether a new passage or message continues the subject of the text before it. Used to cut a long stream (a book, a chat, meeting notes) into topics for a summary tree. | 150M parameters |
|
| 20 |
+
|
| 21 |
+
## About the author
|
| 22 |
+
|
| 23 |
+
Made by **Carl Free**, an AI engineer who trains small, specialized models that beat large general models on narrow tasks at a fraction of the cost. Résumé, demos, and contact: **[ordinarydata.com/resume](https://ordinarydata.com/resume/)**.
|
| 24 |
+
|
| 25 |
+
---
|
| 26 |
+
|
| 27 |
+
# same-subject-r2
|
| 28 |
+
|
| 29 |
+
A cross-encoder (a model that reads two texts together and scores them) fine-tuned from [Alibaba-NLP/gte-reranker-modernbert-base](https://huggingface.co/Alibaba-NLP/gte-reranker-modernbert-base) to answer one question: **is the new text about the same subject as the earlier text?** It returns a probability. It is the classifier behind SumEng, which builds a pyramid of summaries over text that arrives in order: the classifier decides where each topic ends, and a language model only writes one summary per topic.
|
| 30 |
+
|
| 31 |
+
## Results
|
| 32 |
+
|
| 33 |
+
On held-out test pairs (stories and meetings never seen in training):
|
| 34 |
+
|
| 35 |
+
| | Accuracy | AUC |
|
| 36 |
+
|---|---:|---:|
|
| 37 |
+
| this model | 73% | 0.82 |
|
| 38 |
+
| Claude Sonnet, same question | 61% | 0.69 |
|
| 39 |
+
| Claude Haiku, same question | 52% | 0.57 |
|
| 40 |
+
|
| 41 |
+
AUC is the chance that a random "same subject" pair scores above a random "different subject" pair (0.5 is guessing). When it is confident (probability below 0.1 or above 0.9, 42% of checks), it is right 88% of the time.
|
| 42 |
+
|
| 43 |
+
Cutting whole held-out Holmes stories into scenes with the rule below found 17 of 20 scene breaks (Pk 0.37, against 0.49 for fixed-size cuts; lower is better). Speed on a laptop CPU (M1 Pro, 4 threads): about 0.15 s per check at 400 tokens and 0.4 s at 1,000 with PyTorch; onnxruntime was about twice as slow there.
|
| 44 |
+
|
| 45 |
+
## Input
|
| 46 |
+
|
| 47 |
+
A text pair. The first text is the earlier text (the last few passages, or a summary); the second is the new text followed by a blank line and a fixed question:
|
| 48 |
+
|
| 49 |
+
```text
|
| 50 |
+
[earlier] Holder:
|
| 51 |
+
I have a son, Arthur, who has been a disappointment to me...
|
| 52 |
+
|
| 53 |
+
[new] Holmes:
|
| 54 |
+
"Let us go down to Streatham and look at the house."
|
| 55 |
+
|
| 56 |
+
Question: Is the new passage about the same subject as the earlier passages?
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
+
Items are written as `header:\ntext`, separated by blank lines. Use "message" instead of "passage" for chat. Tokenize with `tokenizer.json` as a pair, truncating only the first text, at most 2,048 tokens, and with special tokens in the text treated as plain text (`split_special_tokens=True` in transformers, `encode_special_tokens = True` in tokenizers). The output is one logit; the probability is its sigmoid.
|
| 60 |
+
|
| 61 |
+
## Files
|
| 62 |
+
|
| 63 |
+
- `model.safetensors`, `config.json`: the weights, for PyTorch (`AutoModelForSequenceClassification`, `attn_implementation="sdpa"`).
|
| 64 |
+
- `model.onnx`: the same model for onnxruntime (answers match PyTorch to 0.00001).
|
| 65 |
+
- `tokenizer.json`: the tokenizer. `tokenizer_config.json` was written by transformers 5; with older transformers, build the tokenizer from `tokenizer.json` directly.
|
| 66 |
+
- `sumeng-classifier.json`: the maximum length and the ONNX file's hash.
|
| 67 |
+
|
| 68 |
+
```sh
|
| 69 |
+
uvx hf download freeideas/UsefulLocalModels --include "same-subject-r2/*" --local-dir models
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
## Use it for segmentation
|
| 73 |
+
|
| 74 |
+
A single low answer is not a topic break. What worked: let a group grow until it holds twice a minimum size (3,000 characters), then cut at the point with the lowest probability that leaves the minimum on each side, if that probability is below 0.4; otherwise keep growing.
|
| 75 |
+
|
| 76 |
+
## Training
|
| 77 |
+
|
| 78 |
+
13,639 training pairs from 12 Sherlock Holmes stories (public domain, Project Gutenberg) and 196 AMI and ICSI meetings from [QMSum](https://github.com/Yale-LILY/QMSum) (CC BY 4.0), split by source. Meeting topic boundaries were marked by people; book scene boundaries and all summaries were written by Claude models. Two epochs at learning rate 1e-5 on one L4 GPU; this is the epoch-1 checkpoint.
|
| 79 |
+
|
| 80 |
+
## Limits
|
| 81 |
+
|
| 82 |
+
English only. Meetings of short spoken turns are segmented much less well than books. No chat or email data was used yet. Probabilities are not calibrated; compare them with each other rather than reading them as exact odds.
|