Instructions to use sennaLLMLearner/qwen2.5-7b-memory-distiller with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sennaLLMLearner/qwen2.5-7b-memory-distiller with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sennaLLMLearner/qwen2.5-7b-memory-distiller") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("sennaLLMLearner/qwen2.5-7b-memory-distiller") model = AutoModelForCausalLM.from_pretrained("sennaLLMLearner/qwen2.5-7b-memory-distiller") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - llama-cpp-python
How to use sennaLLMLearner/qwen2.5-7b-memory-distiller with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="sennaLLMLearner/qwen2.5-7b-memory-distiller", filename="qwen2.5-7b-memory-distiller.Q4_K_M.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use sennaLLMLearner/qwen2.5-7b-memory-distiller 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 sennaLLMLearner/qwen2.5-7b-memory-distiller:Q4_K_M # Run inference directly in the terminal: llama cli -hf sennaLLMLearner/qwen2.5-7b-memory-distiller:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf sennaLLMLearner/qwen2.5-7b-memory-distiller:Q4_K_M # Run inference directly in the terminal: llama cli -hf sennaLLMLearner/qwen2.5-7b-memory-distiller: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 sennaLLMLearner/qwen2.5-7b-memory-distiller:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf sennaLLMLearner/qwen2.5-7b-memory-distiller: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 sennaLLMLearner/qwen2.5-7b-memory-distiller:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf sennaLLMLearner/qwen2.5-7b-memory-distiller:Q4_K_M
Use Docker
docker model run hf.co/sennaLLMLearner/qwen2.5-7b-memory-distiller:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use sennaLLMLearner/qwen2.5-7b-memory-distiller with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sennaLLMLearner/qwen2.5-7b-memory-distiller" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sennaLLMLearner/qwen2.5-7b-memory-distiller", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/sennaLLMLearner/qwen2.5-7b-memory-distiller:Q4_K_M
- SGLang
How to use sennaLLMLearner/qwen2.5-7b-memory-distiller 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 "sennaLLMLearner/qwen2.5-7b-memory-distiller" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sennaLLMLearner/qwen2.5-7b-memory-distiller", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "sennaLLMLearner/qwen2.5-7b-memory-distiller" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sennaLLMLearner/qwen2.5-7b-memory-distiller", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use sennaLLMLearner/qwen2.5-7b-memory-distiller with Ollama:
ollama run hf.co/sennaLLMLearner/qwen2.5-7b-memory-distiller:Q4_K_M
- Unsloth Studio
How to use sennaLLMLearner/qwen2.5-7b-memory-distiller with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for sennaLLMLearner/qwen2.5-7b-memory-distiller to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for sennaLLMLearner/qwen2.5-7b-memory-distiller to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for sennaLLMLearner/qwen2.5-7b-memory-distiller to start chatting
- Pi
How to use sennaLLMLearner/qwen2.5-7b-memory-distiller with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf sennaLLMLearner/qwen2.5-7b-memory-distiller:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "sennaLLMLearner/qwen2.5-7b-memory-distiller:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use sennaLLMLearner/qwen2.5-7b-memory-distiller with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf sennaLLMLearner/qwen2.5-7b-memory-distiller: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 sennaLLMLearner/qwen2.5-7b-memory-distiller:Q4_K_M
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use sennaLLMLearner/qwen2.5-7b-memory-distiller with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf sennaLLMLearner/qwen2.5-7b-memory-distiller: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 "sennaLLMLearner/qwen2.5-7b-memory-distiller: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"
- Docker Model Runner
How to use sennaLLMLearner/qwen2.5-7b-memory-distiller with Docker Model Runner:
docker model run hf.co/sennaLLMLearner/qwen2.5-7b-memory-distiller:Q4_K_M
- Lemonade
How to use sennaLLMLearner/qwen2.5-7b-memory-distiller with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull sennaLLMLearner/qwen2.5-7b-memory-distiller:Q4_K_M
Run and chat with the model
lemonade run user.qwen2.5-7b-memory-distiller-Q4_K_M
List all available models
lemonade list
Conversation Memory Distiller (Qwen2.5-7B)
A small model fine-tuned to turn a conversation log into clean, searchable structured-memory
JSON for later recall, running locally on an edge device. Fine-tuned from
Qwen/Qwen2.5-7B-Instruct via SFT warmup → ORPO, distilling a DeepSeek-V3 teacher, and
optimized to follow 5 content principles (below) when compressing a conversation into memory.
This is a structured-distillation (memory-summarization) model, not a general summarizer. It is meant to run locally on an edge device and emit schema-conformant memory objects.
Why this exists
This model powers the local memory layer of codeatrium, a personal-memory app: it distills conversations into searchable memories. The goal was a local / free / private 7B that runs on an edge device (via Ollama Q4_K_M) and could replace the larger distiller previously used in that role. It's a personal project: the dataset and evaluation are small-scale, the "5 principles" are a custom rubric drawn from the memory-distillation literature, and training was stopped pragmatically once it reached practical quality (2 ORPO epochs), not pushed to convergence. Metrics and acceptance gates were pre-registered before running the final evals, and only what survived is reported (see How I know).
Intended use / Out of scope
- Intended: distilling a conversation (user+assistant turns) into a structured memory object (JSON/record with fields) for later search / recall, running locally.
- Out of scope: general-purpose summarization; downstream retrieval/QA quality (not evaluated here — only distillation quality is); absolute faithfulness guarantees.
Learning signal: the 5 core principles
The model is trained with these 5 principles as the preference signal (chosen/rejected). Each is a content-level best practice backed by external work on memory systems and retrieval.
| Principle | Definition | Primary source | Basis (key figure) | How it's measured |
|---|---|---|---|---|
| completeness (recall) | capture the source's important specifics without dropping them | ProMem (arXiv:2601.04463) | verification+completion raises memory integrity 54→74%; +30.89pp vs Mem0 on HaluMem; +10.74pt transfer on Llama3-8B (the one principle confirmed to help at small scale) | deterministic: specifics recall against the source, no LLM judge |
| lexical_fidelity | keep numbers, commands, identifiers verbatim, not paraphrased | SPAR (arXiv:2110.06918) / Searchat (arXiv:2603.13017) | dense retrievers miss rare entities / salient phrases that BM25 catches (lexical-fidelity gap); Searchat retains 96.8% of query vocabulary after distillation | deterministic: verbatim-retention rate among captured specifics (correlated with completeness, not fully independent) |
| atomicity | one memory = one fact; no cramming multiple facts together | TriMem (arXiv:2605.19952) / Mem0 | fact-centric atomic decomposition; coarse-only memory blocks deep reasoning across scattered facts | LLM judge only; no deterministic anchor |
| discriminative | carries specific info that can be retrieved / told apart (not generic labels) | GAAMA (arXiv:2603.27910) / HippoRAG (arXiv:2405.14831) | generic labels ("programming") make megahub nodes that absorb retrieval mass (megahub problem); discriminative tags narrow retrieval | LLM judge only; no deterministic anchor |
| faithfulness (precision) | do not fabricate specifics absent from the source | ProMem (arXiv:2601.04463) / HaluMem (arXiv:2511.03506) | stronger completion increases fabrication risk (the flip side of completeness); HaluMem measures hallucination | deterministic: specifics precision against the source, no LLM judge |
Eval note.
completenessandfaithfulnessare measured without an LLM judge as set recall / precision of specifics (numbers, identifiers, commands, paths, quoted strings) against the source.lexical_fidelityis a supplementary verbatim-retention rate (not independent of completeness).atomicityanddiscriminativerequire structural/semantic judgment and are measured only via LLM judges — they carry no deterministic anchor (see limitations).
Training
- Base:
Qwen/Qwen2.5-7B-Instruct. Teacher: DeepSeek-V3 (distillation target). - Data: technical conversations deterministically sampled from WildChat-1M (en+ja, toxic-filtered) — a small preference set (~hundreds of conversations / thousands of exchanges).
- Recipe: SFT warmup → merge → fresh LoRA (r16) → ORPO (2 epochs).
How I know
I evaluated distillation quality (the 5 principles), not downstream retrieval. Metrics and acceptance gates were pre-registered before the final runs.
It beats the incumbent on the deployment task. On my codeatrium production path (all arms
Ollama Q4_K_M, 48 independent real conversations), this 7B outperforms both
qwen2.5-coder:14b (my previous distiller) and raw qwen2.5:7b. The win is not judge-dependent —
it holds under a same-family judge (Qwen2.5-72B), a different-family judge (Llama-3.3-70B), a
judge-free specifics metric, and a blind human rating (n=30, FT vs the 14B):
- completeness is confirmed by all four methods (human net +0.63, p≈7e-5) — the flagship result.
- discriminative (+0.47) and lexical_fidelity (+0.37) are also human-confirmed vs the 14B.
It generalizes to unseen structured schemas — but not to everything. On 5 held-out schemas it never trained on (measured judge-free), it beats raw 7B on field-structured formats (nested JSON, typed record, entity-relation graph — all significant) but only ties on flat / hard-length-capped formats (flat Markdown bullets, ≤12-word YAML). So the honest claim is: generalizes to unseen field-structured schemas; no edge on flat / heavily-constrained formats. (codeatrium's schema is field-structured, consistent with the deployment win.)
Limitations (read this)
- Small-scale & personal. Small dataset; evals of n=30–48; training stopped at practical utility.
atomicityis measurement-limited. LLM judges score a large FT win, but blind humans rated it a near-tie (27/30 ties) — the judge win is not human-confirmed. Treat atomicity cautiously.discriminativeis family-sensitive. Human- and judge-confirmed vs the 14B, but vs raw 7B it was not significant under a cross-family judge.- The human eval is author-blind, not third-party. I rated blind (arm-anonymized, order randomized), which removes judge-family bias, but I built the model and know its style — so it is not a fully independent human evaluation. (It was conservative: 88/150 ratings were ties.)
- The 5 principles are my own rubric, not a standard benchmark; absolute faithfulness is low on hard prompts (the claim is "more faithful than the baselines," paired — not "faithful" in absolute terms).
- Downstream utility (retrieval/QA) is not evaluated. Scope is distillation quality only.
Usage
Deployment target is Ollama Q4_K_M, called via an OpenAI-compatible endpoint
(http://localhost:11434/v1) — the same path codeatrium uses. Prompt the model with your distillation
instruction + schema + the conversation, and read back the structured JSON (greedy / temperature 0 for
determinism). The 5-principle behavior is strongest on field-structured schemas.
Technical note: this repo ships the fully merged weights (base ⊕ SFT-LoRA ⊕ ORPO-LoRA already baked in) — load it directly like any Qwen2.5-7B checkpoint, no adapter reconstruction needed. Internally it was trained as
stock Qwen ⊕ SFT-LoRA → merge → ⊕ ORPO-LoRA → merge; that provenance only matters if you're retraining from an intermediate checkpoint, not for inference.
References
- ProMem — proactive memory verification & completion. arXiv:2601.04463
- SPAR — lexical-fidelity gap of dense retrievers. arXiv:2110.06918 (EMNLP-Findings 2022)
- Searchat — structured distillation / surviving vocabulary. arXiv:2603.13017
- TriMem — multi-granularity memory (segment / atomic fact / profile). arXiv:2605.19952
- HaluMem — memory hallucination benchmark. arXiv:2511.03506
- GAAMA — graph-augmented associative memory (megahub avoidance). arXiv:2603.27910 / github.com/swarna-kpaul/gaama
- HippoRAG — neurobiologically-inspired long-term memory / entity-centric KG retrieval (hub-concentration evidence). arXiv:2405.14831
- Downloads last month
- 571