初始化项目,由ModelHub XC社区提供模型

Model: Mungert/mem-agent-GGUF
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-10-22 01:18:16 +08:00
commit 32b288f233
27 changed files with 343 additions and 0 deletions

60
.gitattributes vendored Normal file
View File

@@ -0,0 +1,60 @@
*.7z filter=lfs diff=lfs merge=lfs -text
*.arrow filter=lfs diff=lfs merge=lfs -text
*.bin filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.ckpt filter=lfs diff=lfs merge=lfs -text
*.ftz filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.h5 filter=lfs diff=lfs merge=lfs -text
*.joblib filter=lfs diff=lfs merge=lfs -text
*.lfs.* filter=lfs diff=lfs merge=lfs -text
*.mlmodel filter=lfs diff=lfs merge=lfs -text
*.model filter=lfs diff=lfs merge=lfs -text
*.msgpack filter=lfs diff=lfs merge=lfs -text
*.npy filter=lfs diff=lfs merge=lfs -text
*.npz filter=lfs diff=lfs merge=lfs -text
*.onnx filter=lfs diff=lfs merge=lfs -text
*.ot filter=lfs diff=lfs merge=lfs -text
*.parquet filter=lfs diff=lfs merge=lfs -text
*.pb filter=lfs diff=lfs merge=lfs -text
*.pickle filter=lfs diff=lfs merge=lfs -text
*.pkl filter=lfs diff=lfs merge=lfs -text
*.pt filter=lfs diff=lfs merge=lfs -text
*.pth filter=lfs diff=lfs merge=lfs -text
*.rar filter=lfs diff=lfs merge=lfs -text
*.safetensors filter=lfs diff=lfs merge=lfs -text
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
*.tar.* filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.tflite filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.wasm filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text
*tfevents* filter=lfs diff=lfs merge=lfs -text
mem-agent-f16_q8_0.gguf filter=lfs diff=lfs merge=lfs -text
mem-agent-bf16_q8_0.gguf filter=lfs diff=lfs merge=lfs -text
mem-agent-q2_k_m.gguf filter=lfs diff=lfs merge=lfs -text
mem-agent-q2_k_s.gguf filter=lfs diff=lfs merge=lfs -text
mem-agent-q3_k_m.gguf filter=lfs diff=lfs merge=lfs -text
mem-agent-q3_k_s.gguf filter=lfs diff=lfs merge=lfs -text
mem-agent-q4_k_m.gguf filter=lfs diff=lfs merge=lfs -text
mem-agent-q4_k_s.gguf filter=lfs diff=lfs merge=lfs -text
mem-agent-q8_0.gguf filter=lfs diff=lfs merge=lfs -text
mem-agent-q4_0.gguf filter=lfs diff=lfs merge=lfs -text
mem-agent-q4_1.gguf filter=lfs diff=lfs merge=lfs -text
mem-agent-q5_0.gguf filter=lfs diff=lfs merge=lfs -text
mem-agent-q5_1.gguf filter=lfs diff=lfs merge=lfs -text
mem-agent-iq1_s.gguf filter=lfs diff=lfs merge=lfs -text
mem-agent-iq1_m.gguf filter=lfs diff=lfs merge=lfs -text
mem-agent-iq2_xs.gguf filter=lfs diff=lfs merge=lfs -text
mem-agent-iq2_xxs.gguf filter=lfs diff=lfs merge=lfs -text
mem-agent-iq2_s.gguf filter=lfs diff=lfs merge=lfs -text
mem-agent-iq2_m.gguf filter=lfs diff=lfs merge=lfs -text
mem-agent-iq3_xxs.gguf filter=lfs diff=lfs merge=lfs -text
mem-agent-iq3_m.gguf filter=lfs diff=lfs merge=lfs -text
mem-agent-iq4_xs.gguf filter=lfs diff=lfs merge=lfs -text
mem-agent-iq4_nl.gguf filter=lfs diff=lfs merge=lfs -text
mem-agent-imatrix.gguf filter=lfs diff=lfs merge=lfs -text
mem-agent-bf16.gguf filter=lfs diff=lfs merge=lfs -text

208
README.md Normal file
View File

@@ -0,0 +1,208 @@
---
pipeline_tag: text-generation
library_name: transformers
---
# <span style="color: #7FFF7F;">mem-agent GGUF Models</span>
## <span style="color: #7F7FFF;">Model Generation Details</span>
This model was generated using [llama.cpp](https://github.com/ggerganov/llama.cpp) at commit [`1d0125bc`](https://github.com/ggerganov/llama.cpp/commit/1d0125bcf1cbd7195ad0faf826a20bc7cec7d3f4).
---
## <span style="color: #7FFF7F;">Quantization Beyond the IMatrix</span>
I've been experimenting with a new quantization approach that selectively elevates the precision of key layers beyond what the default IMatrix configuration provides.
In my testing, standard IMatrix quantization underperforms at lower bit depths, especially with Mixture of Experts (MoE) models. To address this, I'm using the `--tensor-type` option in `llama.cpp` to manually "bump" important layers to higher precision. You can see the implementation here:
👉 [Layer bumping with llama.cpp](https://github.com/Mungert69/GGUFModelBuilder/blob/main/model-converter/tensor_list_builder.py)
While this does increase model file size, it significantly improves precision for a given quantization level.
### **I'd love your feedback—have you tried this? How does it perform for you?**
---
<a href="https://readyforquantum.com/huggingface_gguf_selection_guide.html" style="color: #7FFF7F;">
Click here to get info on choosing the right GGUF model format
</a>
---
<!--Begin Original Model Card-->
# mem-agent
Based on [Qwen3-4B-Thinking-2507](https://huggingface.co/Qwen/Qwen3-4B-Thinking-2507), this model was trained using GSPO (Zheng et al., 2025) over an agent scaffold that is built around an Obisidian-like memory system and the tools required to interact with it. The model was trained on the following subtasks:
- Retrieval: Retrieving relevant information when needed from the memory system. In this subtask, we also trained the model on filtering the retrieved information and/or obfuscating it completely.
- Updating: Updating the memory system with new information.
- Clarification: Asking for clarification when the user query is not clear/contradicting with the information in the memory system.
The tools in the scaffold are:
```markdown
# File Operations
create_file(file_path: str, content: str = "") -> bool # Auto-creates parent directories
update_file(file_path: str, old_content: str, new_content: str) -> Union[bool, str] # Returns True or error message
read_file(file_path: str) -> str
delete_file(file_path: str) -> bool
check_if_file_exists(file_path: str) -> bool
# Directory Operations
create_dir(dir_path: str) -> bool
list_files() -> str # Shows tree structure of current working directory
check_if_dir_exists(dir_path: str) -> bool
# Utilities
get_size(file_or_dir_path: str) -> int # Bytes; empty = total memory size
go_to_link(link_string: str) -> bool
```
In the scaffold, the model uses `<think>`, `<python>` and `<reply>` tags to structure its response. Using `<reply>` only when it's done interacting with the memory. The `<python>` block is executed in a sandbox with the tools and the results of the code block are returned in a `<result>` tag to the model, forming the agentic loop.
The model is also trained to be able to handle optional filters given by the user in between <filter> tags after the user query. These filters are used to filter the retrieved information and/or obfuscate it completely.
## Benchmark
We evaluated this model and a few other open & closed ones on our benchmark, **md-memory-bench**. We used o3 from OpenAI as the judge. All the other models except driaforall/mem-agent and Qwen/Qwen3-4B-Thinking-2507 were used through OpenRouter.s
| Model | Retrieval | Update | Clarification | Filter | Overall |
|-------|-----------|--------|---------------|--------|---------|
| qwen/qwen3-235b-a22b-thinking-2507 | 0.9091 | 0.6363 | 0.4545 | 1 | 0.7857 |
| driaforall/mem-agent | 0.8636 | 0.7272 | 0.3636 | 0.9167 | 0.75 |
| z-ai/glm-4.5 | 0.7727 | 0.8181 | 0.3636 | 0.9167 | 0.7321 |
| deepseek/deepseek-chat-v3.1 | 0.6818 | 0.5454 | 0.5454 | 0.8333 | 0.6607 |
| google/gemini-2.5-pro | 0.7273 | 0.4545 | 0.2727 | 1 | 0.6429 |
| google/gemini-2.5-flash | 0.7727 | 0.3636 | 0.2727 | 0.9167 | 0.625 |
| openai/gpt-5 | 0.6818 | 0.5454 | 0.2727 | 0.9167 | 0.625 |
| anthropic/claude-opus-4.1 | 0.6818 | 0 | 0.8181 | 0.5833 | 0.5536 |
| Qwen/Qwen3-4B-Thinking-2507 | 0.4545 | 0 | 0.2727 | 0.75 | 0.3929 |
| moonshotai/kimi-k2 | 0.3181 | 0.2727 | 0.1818 | 0.6667 | 0.3571 |
Our model, with only 4B parameters, is only second on the benchmark, beating all the open & closed models except for qwen/qwen3-235b-a22b-thinking-2507. The model achieves an overall score of 0.75, a significant improvement over the 0.3929 of the base Qwen model.
## Usage
The model, while can be used on its own, is recommended to be used as an MCP server to a bigger model, which can then be used to interact with the memory system. For this, you can check [our repo](https://github.com/firstbatchxyz/mem-agent-mcp/), which contains instructions for both an MCP setup and a cli standalone model usage.
### Memory
The model uses a markdown based memory system with links, inspired by Obsidian. The general structure of the memory is:
```
memory/
├── user.md
└── entities/
└── [entity_name_1].md
└── [entity_name_2].md
└── ...
```
- `user.md` is the main file that contains information about the user and their relationships, accompanied by links to the enity file in the format of `[[entities/[entity_name].md]]` per relationship. The link format should be followed strictly.
- `entities/` is the directory that contains the entity files.
- Each entity file follows the same structure as `user.md`.
- Modifying the memory manually does not require restarting the MCP server.
### Example user.md
```markdown
# User Information
- user_name: John Doe
- birth_date: 1990-01-01
- birth_location: New York, USA
- living_location: Enschede, Netherlands
- zodiac_sign: Aquarius
## User Relationships
- company: [[entities/acme_corp.md]]
- mother: [[entities/jane_doe.md]]
```
### Example entity files (jane_doe.md and acme_corp.md)
```markdown
# Jane Doe
- relationship: Mother
- birth_date: 1965-01-01
- birth_location: New York, USA
```
```markdown
# Acme Corporation
- industry: Software Development
- location: Enschede, Netherlands
```
The model is trained on this memory standard and any fruitful use should be on a memory system that follows this standard. We have a few memory export tools for different sources like ChatGPT, Notion, etc. in our mcp server repo.
## References:
- [GSPO](https://arxiv.org/pdf/2507.18071), Zheng et al., 2025
<!--End Original Model Card-->
---
# <span id="testllm" style="color: #7F7FFF;">🚀 If you find these models useful</span>
Help me test my **AI-Powered Quantum Network Monitor Assistant** with **quantum-ready security checks**:
👉 [Quantum Network Monitor](https://readyforquantum.com/?assistant=open&utm_source=huggingface&utm_medium=referral&utm_campaign=huggingface_repo_readme)
The full Open Source Code for the Quantum Network Monitor Service available at my github repos ( repos with NetworkMonitor in the name) : [Source Code Quantum Network Monitor](https://github.com/Mungert69). You will also find the code I use to quantize the models if you want to do it yourself [GGUFModelBuilder](https://github.com/Mungert69/GGUFModelBuilder)
💬 **How to test**:
Choose an **AI assistant type**:
- `TurboLLM` (GPT-4.1-mini)
- `HugLLM` (Hugginface Open-source models)
- `TestLLM` (Experimental CPU-only)
### **What I’m Testing**
I’m pushing the limits of **small open-source models for AI network monitoring**, specifically:
- **Function calling** against live network services
- **How small can a model go** while still handling:
- Automated **Nmap security scans**
- **Quantum-readiness checks**
- **Network Monitoring tasks**
🟡 **TestLLM** – Current experimental model (llama.cpp on 2 CPU threads on huggingface docker space):
- ✅ **Zero-configuration setup**
- ⏳ 30s load time (slow inference but **no API costs**) . No token limited as the cost is low.
- 🔧 **Help wanted!** If you’re into **edge-device AI**, let’s collaborate!
### **Other Assistants**
🟢 **TurboLLM** – Uses **gpt-4.1-mini** :
- **It performs very well but unfortunatly OpenAI charges per token. For this reason tokens usage is limited.
- **Create custom cmd processors to run .net code on Quantum Network Monitor Agents**
- **Real-time network diagnostics and monitoring**
- **Security Audits**
- **Penetration testing** (Nmap/Metasploit)
🔵 **HugLLM** – Latest Open-source models:
- 🌐 Runs on Hugging Face Inference API. Performs pretty well using the lastest models hosted on Novita.
### 💡 **Example commands you could test**:
1. `"Give me info on my websites SSL certificate"`
2. `"Check if my server is using quantum safe encyption for communication"`
3. `"Run a comprehensive security audit on my server"`
4. '"Create a cmd processor to .. (what ever you want)" Note you need to install a [Quantum Network Monitor Agent](https://readyforquantum.com/Download/?utm_source=huggingface&utm_medium=referral&utm_campaign=huggingface_repo_readme) to run the .net code on. This is a very flexible and powerful feature. Use with caution!
### Final Word
I fund the servers used to create these model files, run the Quantum Network Monitor service, and pay for inference from Novita and OpenAI—all out of my own pocket. All the code behind the model creation and the Quantum Network Monitor project is [open source](https://github.com/Mungert69). Feel free to use whatever you find helpful.
If you appreciate the work, please consider [buying me a coffee](https://www.buymeacoffee.com/mahadeva) ☕. Your support helps cover service costs and allows me to raise token limits for everyone.
I'm also open to job opportunities or sponsorship.
Thank you! 😊

3
mem-agent-bf16.gguf Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:def167809008e582ab8830a298adc9e7413200acf40296705ad9d4edfcef8840
size 8051284800

3
mem-agent-bf16_q8_0.gguf Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f3c1fadc332ab913fe9875a9d85b771732f78d2c85c94088abaffadb0cb22c75
size 5927918400

3
mem-agent-f16_q8_0.gguf Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e1592db4a49a5561aee098730041abea2094bfb9db222bd4b9db33047c2a8626
size 5927918400

3
mem-agent-imatrix.gguf Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cc75428bccd61d1b1170cb9731556b61a9b1b7cd853c234c76eb944445e96808
size 3872672

3
mem-agent-iq1_m.gguf Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ed6e410fbefd389dfebe3f005f1e43baf7b7590202c2549b6c0a32122e90950e
size 1219825280

3
mem-agent-iq1_s.gguf Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:74e37a7c7f8f1b6fa3d4bbfb0a0105ac26ca7c1ebe22cc7250fbea91149fddea
size 1129590400

3
mem-agent-iq2_m.gguf Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:162a76da0f57a6ed5c8ab5d6b996839dd08ced46824d631aafc5845d131d63c9
size 1507126400

3
mem-agent-iq2_s.gguf Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b60dbeac63096b7086f33facf0bb9d8755ccfa14c2017c8a78e159395201485b
size 1442901120

3
mem-agent-iq2_xs.gguf Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0a991d105174ec5d30b40254e46501de46981c574f17c22a8826a74ec2f78ed1
size 1397558400

3
mem-agent-iq2_xxs.gguf Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:636506a206fe55976ff46f88b48cf477a10d76d3ca40036d0c066c16079920c5
size 1293315200

3
mem-agent-iq3_m.gguf Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9843a379ac15ed3db7dc430797e47331e1534645e2b24ddf82586944cce57c60
size 1951378560

3
mem-agent-iq3_xxs.gguf Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ddefb7ab118d1cdb348b774f14bee68a91b8923ba5c2aa9178b677d136d4747a
size 1722043520

3
mem-agent-iq4_nl.gguf Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6c8d331c3a74b4590af17bf45a3077f8ab556db55e4e9659b77d0131d9ac1808
size 2281065600

3
mem-agent-iq4_xs.gguf Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5042273018b9349e9ea678294370eeedba5d6050b0ff60567767df84e97a00cd
size 2270751360

3
mem-agent-q2_k_m.gguf Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:601f27e464bc73e902d0f9eff13d8e316845e777f1e047ae764f3218cb7f96ed
size 1542925440

3
mem-agent-q2_k_s.gguf Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cc3b1508bdfc5674a9418ac3b2a46fbbdf85d73533a2e29f7e1b833b1a25f443
size 1491267200

3
mem-agent-q3_k_m.gguf Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fc534302b38eb2a8587ab1c6bfc461310ce86480092f9135456208425864f33b
size 2007903360

3
mem-agent-q3_k_s.gguf Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fc9f846762f3c53a95376078e8d428669d6dc4c36093d4b69710d61459f80724
size 1959283840

3
mem-agent-q4_0.gguf Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:321163d5e08142c888b9bb4faa9694a61093082b377c734802427f233df429ca
size 2269269120

3
mem-agent-q4_1.gguf Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:81461c71c1ae2809b57c47003683b93e3655002e4ae0094176cc841a6a4d193b
size 2520661120

3
mem-agent-q4_k_m.gguf Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e3a683152b784a1b4f57ff90d32a3536c24e6fbba53beaa909600c13c1cff738
size 2478520960

3
mem-agent-q4_k_s.gguf Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:781bb021f7a452bb26bef247eb970af29c24f552c4983f42d83f0f2a841b350b
size 2355899520

3
mem-agent-q5_0.gguf Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2c316611d34753c66adc342946e4bed869257dcf2f3000b7e2a4396b65e6525d
size 2772053120

3
mem-agent-q5_1.gguf Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a81e2d18c4078e29d4f46d7fc975fb5f1c1b9879525f579f66565218c74e93a2
size 3023445120

3
mem-agent-q8_0.gguf Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:07d9fc763bd96f3b600438edc9b1f8a142c449a82bead9237d2cc8d8b078934b
size 4280404800