commit cb9520aae93ec68fd9990171fd51312e9eb613ab Author: ModelHub XC Date: Thu Jun 11 18:26:16 2026 +0800 初始化项目,由ModelHub XC社区提供模型 Model: chkrishna2001/psm-memory-qwen-1.5b-gguf Source: Original Platform diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..af22005 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +*.gguf filter=lfs diff=lfs merge=lfs -text +*.safetensors filter=lfs diff=lfs merge=lfs -text +gguf/** filter=lfs diff=lfs merge=lfs -text +merged-fp16/*.safetensors filter=lfs diff=lfs merge=lfs -text +lora/*.safetensors filter=lfs diff=lfs merge=lfs -text +*.json filter=lfs diff=lfs merge=lfs -text diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..bb1178b --- /dev/null +++ b/LICENSE @@ -0,0 +1,8 @@ +This model is derived from Qwen1.5-1.8B and inherits the base model license. + +License: Tongyi Qianwen Research License +License URL: https://huggingface.co/Qwen/Qwen1.5-1.8B/blob/main/LICENSE + +The files in this repository are model artifacts for PSM Memory, a memory-management model derived from Qwen1.5-1.8B. Use of the model weights is governed by the upstream Qwen1.5-1.8B license terms. + +The PSM Memory npm package source code is licensed separately in the code repository. diff --git a/README.md b/README.md new file mode 100644 index 0000000..32e2790 --- /dev/null +++ b/README.md @@ -0,0 +1,105 @@ +--- +license: other +license_name: tongyi-qianwen-research +license_link: https://huggingface.co/Qwen/Qwen1.5-1.8B/blob/main/LICENSE +base_model: Qwen/Qwen1.5-1.8B +tags: + - gguf + - qwen + - qwen1.5 + - lora + - memory + - agent-memory + - psm-memory +library_name: transformers +pipeline_tag: text-generation +--- + +# PSM Memory Qwen 1.5B + +PSM Memory is a small model trained for memory-management operations in agent systems. It is not intended to answer user questions directly. It is intended to decide what should be remembered, retrieve and rank relevant memories, detect conflicts, and support memory lifecycle operations. + +This repository contains the runtime artifacts for the PSM Memory model derived from Qwen1.5-1.8B. + +## Files + +### GGUF runtime artifacts + +- `gguf/psm-memory-qwen-1.5b-q4_k_m.gguf` + - Recommended default runtime artifact for `@psm-memory/cli` and `@psm-memory/pi-plugin`. + - Quantized GGUF for local inference. + +- `gguf/psm-memory-qwen-1.5b-f16.gguf` + - Full precision GGUF export. + - Larger and slower, useful for quality comparison and future quantization. + +### Hugging Face / Transformers artifacts + +- `merged-fp16/` + - Merged FP16 model weights and tokenizer/config files. + - Useful for inspection, conversion, or further export. + +- `lora/` + - LoRA adapter weights and tokenizer/config files. + - Useful for reproducibility and future fine-tuning work. + +### Integrity + +- `checksums.sha256` + - SHA-256 checksums for uploaded artifacts. + +## Intended Use + +Use this model as a memory-management component for an LLM agent: + +1. User prompt arrives. +2. PSM Memory retrieves/ranks relevant memories and produces context for the main LLM. +3. Main LLM responds or takes an action. +4. PSM Memory evaluates the response/action and stores durable memory when appropriate. + +The npm packages are: + +- `@psm-memory/sdk` +- `@psm-memory/cli` +- `@psm-memory/pi-plugin` + +The CLI/plugin should use the Q4_K_M GGUF artifact by default. + +## Not Intended For + +- General chat completion. +- Factual QA as a standalone assistant. +- Safety-critical autonomous decision-making without external validation. +- Storing private user data without consent and appropriate access controls. + +## License + +This model is a fine-tuned/converted PSM Memory model derived from Qwen1.5-1.8B. + +The model weights are distributed under the Tongyi Qianwen Research License inherited from the base model: + +https://huggingface.co/Qwen/Qwen1.5-1.8B/blob/main/LICENSE + +The PSM Memory npm package code is licensed separately in its source repository. + +## Training Data + +The upload bundle does not include training data by default. If synthetic training data is published, it should be uploaded only after checking that it contains no private, personal, or proprietary content. + +Recommended approach: + +- Add a separate `training-data/` folder for synthetic examples. +- Include a short data card explaining how the data was generated. +- Include only sanitized synthetic data or a representative sample if the full dataset is large. + +## Reproducibility Notes + +A Colab notebook is not required for using this model. It is useful if you want others to reproduce conversion, quantization, or adapter loading. + +Recommended optional notebooks: + +- `notebooks/convert-to-gguf.ipynb` +- `notebooks/quantize-gguf.ipynb` +- `notebooks/run-psm-memory.ipynb` + +These can be added later without blocking CLI setup support. diff --git a/checksums.sha256 b/checksums.sha256 new file mode 100644 index 0000000..9c2c424 --- /dev/null +++ b/checksums.sha256 @@ -0,0 +1,17 @@ +3863f2c8afec2d88d900169d705030ec2a36dbf100b27004973b4696cf3424e8 gguf/psm-memory-qwen-1.5b-f16.gguf +05a35ea07f27514e20db9f55e28d4e6f51a15c1684125067a0b65f9b483cc6e3 gguf/psm-memory-qwen-1.5b-q4_k_m.gguf +f68eccfd49f84e0d87de4bdf418296badf1d49b90440b6e41718a28e117134a7 LICENSE +d07f07a17b2c21199f8b88a1f9703924252da7833d9102b56d69428e31fa2659 lora/adapter_config.json +3b797d0c84f46a37c27b3095ad335df2719cabd8f3bdf0cc1dbd92c3e2852891 lora/adapter_model.safetensors +cd8e9439f0570856fd70470bf8889ebd8b5d1107207f67a5efb46e342330527f lora/chat_template.jinja +64b7055b4141fff271e651244cf5e5e8f962d0780bbb72fc119da70a89cb3e92 lora/README.md +bd5948af71b4f56cf697f7580814c7ce8b80595ef985544efcacf716126a2e31 lora/tokenizer.json +cc1a48982e39fe91fb630298e09fdc4dfb48903488dd89db0ada95b76abcd8e3 lora/tokenizer_config.json +cd8e9439f0570856fd70470bf8889ebd8b5d1107207f67a5efb46e342330527f merged-fp16/chat_template.jinja +c6fe78a0b599d02fd77278e914250efe913a8c51161df270428335540acfd35c merged-fp16/config.json +2f6ae45953dd2ab26b7d01bb03dcac230f78959ac4999133144203e86c1f8923 merged-fp16/model.safetensors +bd5948af71b4f56cf697f7580814c7ce8b80595ef985544efcacf716126a2e31 merged-fp16/tokenizer.json +ec2342b980a851bfe1b7c12ad9bc9b4efa9454e7d627b1d3fdcc1a45d6798a25 merged-fp16/tokenizer_config.json +2391af20d51d4fd15cc94ec99b7194c94745b3ad8c23e3c2c6b52003fa5d8919 notebooks/README.md +fc23b46b6d9f371df6ebf23616d1808fbb334c3f1d177f84b7728892b5b01697 README.md +1edc0dcc2615190d46ab8716283535b6396851dab939e23970b84098f29ddec5 training-data/README.md diff --git a/gguf/psm-memory-qwen-1.5b-f16.gguf b/gguf/psm-memory-qwen-1.5b-f16.gguf new file mode 100644 index 0000000..6a9faaf --- /dev/null +++ b/gguf/psm-memory-qwen-1.5b-f16.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3863f2c8afec2d88d900169d705030ec2a36dbf100b27004973b4696cf3424e8 +size 3093668672 diff --git a/gguf/psm-memory-qwen-1.5b-q4_k_m.gguf b/gguf/psm-memory-qwen-1.5b-q4_k_m.gguf new file mode 100644 index 0000000..451a225 --- /dev/null +++ b/gguf/psm-memory-qwen-1.5b-q4_k_m.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:05a35ea07f27514e20db9f55e28d4e6f51a15c1684125067a0b65f9b483cc6e3 +size 986047808 diff --git a/lora/README.md b/lora/README.md new file mode 100644 index 0000000..96bca07 --- /dev/null +++ b/lora/README.md @@ -0,0 +1,210 @@ +--- +base_model: unsloth/Qwen2.5-1.5B-Instruct +library_name: peft +pipeline_tag: text-generation +tags: +- base_model:adapter:unsloth/Qwen2.5-1.5B-Instruct +- lora +- sft +- transformers +- trl +- unsloth +--- + +# Model Card for Model ID + + + + + +## Model Details + +### Model Description + + + + + +- **Developed by:** [More Information Needed] +- **Funded by [optional]:** [More Information Needed] +- **Shared by [optional]:** [More Information Needed] +- **Model type:** [More Information Needed] +- **Language(s) (NLP):** [More Information Needed] +- **License:** [More Information Needed] +- **Finetuned from model [optional]:** [More Information Needed] + +### Model Sources [optional] + + + +- **Repository:** [More Information Needed] +- **Paper [optional]:** [More Information Needed] +- **Demo [optional]:** [More Information Needed] + +## Uses + + + +### Direct Use + + + +[More Information Needed] + +### Downstream Use [optional] + + + +[More Information Needed] + +### Out-of-Scope Use + + + +[More Information Needed] + +## Bias, Risks, and Limitations + + + +[More Information Needed] + +### Recommendations + + + +Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations. + +## How to Get Started with the Model + +Use the code below to get started with the model. + +[More Information Needed] + +## Training Details + +### Training Data + + + +[More Information Needed] + +### Training Procedure + + + +#### Preprocessing [optional] + +[More Information Needed] + + +#### Training Hyperparameters + +- **Training regime:** [More Information Needed] + +#### Speeds, Sizes, Times [optional] + + + +[More Information Needed] + +## Evaluation + + + +### Testing Data, Factors & Metrics + +#### Testing Data + + + +[More Information Needed] + +#### Factors + + + +[More Information Needed] + +#### Metrics + + + +[More Information Needed] + +### Results + +[More Information Needed] + +#### Summary + + + +## Model Examination [optional] + + + +[More Information Needed] + +## Environmental Impact + + + +Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700). + +- **Hardware Type:** [More Information Needed] +- **Hours used:** [More Information Needed] +- **Cloud Provider:** [More Information Needed] +- **Compute Region:** [More Information Needed] +- **Carbon Emitted:** [More Information Needed] + +## Technical Specifications [optional] + +### Model Architecture and Objective + +[More Information Needed] + +### Compute Infrastructure + +[More Information Needed] + +#### Hardware + +[More Information Needed] + +#### Software + +[More Information Needed] + +## Citation [optional] + + + +**BibTeX:** + +[More Information Needed] + +**APA:** + +[More Information Needed] + +## Glossary [optional] + + + +[More Information Needed] + +## More Information [optional] + +[More Information Needed] + +## Model Card Authors [optional] + +[More Information Needed] + +## Model Card Contact + +[More Information Needed] +### Framework versions + +- PEFT 0.19.1 \ No newline at end of file diff --git a/lora/adapter_config.json b/lora/adapter_config.json new file mode 100644 index 0000000..296cced --- /dev/null +++ b/lora/adapter_config.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d07f07a17b2c21199f8b88a1f9703924252da7833d9102b56d69428e31fa2659 +size 1245 diff --git a/lora/adapter_model.safetensors b/lora/adapter_model.safetensors new file mode 100644 index 0000000..27811f1 --- /dev/null +++ b/lora/adapter_model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b797d0c84f46a37c27b3095ad335df2719cabd8f3bdf0cc1dbd92c3e2852891 +size 147770496 diff --git a/lora/chat_template.jinja b/lora/chat_template.jinja new file mode 100644 index 0000000..bdf7919 --- /dev/null +++ b/lora/chat_template.jinja @@ -0,0 +1,54 @@ +{%- if tools %} + {{- '<|im_start|>system\n' }} + {%- if messages[0]['role'] == 'system' %} + {{- messages[0]['content'] }} + {%- else %} + {{- 'You are Qwen, created by Alibaba Cloud. You are a helpful assistant.' }} + {%- endif %} + {{- "\n\n# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within XML tags:\n" }} + {%- for tool in tools %} + {{- "\n" }} + {{- tool | tojson }} + {%- endfor %} + {{- "\n\n\nFor each function call, return a json object with function name and arguments within XML tags:\n\n{\"name\": , \"arguments\": }\n<|im_end|>\n" }} +{%- else %} + {%- if messages[0]['role'] == 'system' %} + {{- '<|im_start|>system\n' + messages[0]['content'] + '<|im_end|>\n' }} + {%- else %} + {{- '<|im_start|>system\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>\n' }} + {%- endif %} +{%- endif %} +{%- for message in messages %} + {%- if (message.role == "user") or (message.role == "system" and not loop.first) or (message.role == "assistant" and not message.tool_calls) %} + {{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }} + {%- elif message.role == "assistant" %} + {{- '<|im_start|>' + message.role }} + {%- if message.content %} + {{- '\n' + message.content }} + {%- endif %} + {%- for tool_call in message.tool_calls %} + {%- if tool_call.function is defined %} + {%- set tool_call = tool_call.function %} + {%- endif %} + {{- '\n\n{"name": "' }} + {{- tool_call.name }} + {{- '", "arguments": ' }} + {{- tool_call.arguments | tojson }} + {{- '}\n' }} + {%- endfor %} + {{- '<|im_end|>\n' }} + {%- elif message.role == "tool" %} + {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != "tool") %} + {{- '<|im_start|>user' }} + {%- endif %} + {{- '\n\n' }} + {{- message.content }} + {{- '\n' }} + {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %} + {{- '<|im_end|>\n' }} + {%- endif %} + {%- endif %} +{%- endfor %} +{%- if add_generation_prompt %} + {{- '<|im_start|>assistant\n' }} +{%- endif %} diff --git a/lora/tokenizer.json b/lora/tokenizer.json new file mode 100644 index 0000000..5340d81 --- /dev/null +++ b/lora/tokenizer.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bd5948af71b4f56cf697f7580814c7ce8b80595ef985544efcacf716126a2e31 +size 11422356 diff --git a/lora/tokenizer_config.json b/lora/tokenizer_config.json new file mode 100644 index 0000000..3c07f1c --- /dev/null +++ b/lora/tokenizer_config.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc1a48982e39fe91fb630298e09fdc4dfb48903488dd89db0ada95b76abcd8e3 +size 4591 diff --git a/merged-fp16/chat_template.jinja b/merged-fp16/chat_template.jinja new file mode 100644 index 0000000..bdf7919 --- /dev/null +++ b/merged-fp16/chat_template.jinja @@ -0,0 +1,54 @@ +{%- if tools %} + {{- '<|im_start|>system\n' }} + {%- if messages[0]['role'] == 'system' %} + {{- messages[0]['content'] }} + {%- else %} + {{- 'You are Qwen, created by Alibaba Cloud. You are a helpful assistant.' }} + {%- endif %} + {{- "\n\n# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within XML tags:\n" }} + {%- for tool in tools %} + {{- "\n" }} + {{- tool | tojson }} + {%- endfor %} + {{- "\n\n\nFor each function call, return a json object with function name and arguments within XML tags:\n\n{\"name\": , \"arguments\": }\n<|im_end|>\n" }} +{%- else %} + {%- if messages[0]['role'] == 'system' %} + {{- '<|im_start|>system\n' + messages[0]['content'] + '<|im_end|>\n' }} + {%- else %} + {{- '<|im_start|>system\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>\n' }} + {%- endif %} +{%- endif %} +{%- for message in messages %} + {%- if (message.role == "user") or (message.role == "system" and not loop.first) or (message.role == "assistant" and not message.tool_calls) %} + {{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }} + {%- elif message.role == "assistant" %} + {{- '<|im_start|>' + message.role }} + {%- if message.content %} + {{- '\n' + message.content }} + {%- endif %} + {%- for tool_call in message.tool_calls %} + {%- if tool_call.function is defined %} + {%- set tool_call = tool_call.function %} + {%- endif %} + {{- '\n\n{"name": "' }} + {{- tool_call.name }} + {{- '", "arguments": ' }} + {{- tool_call.arguments | tojson }} + {{- '}\n' }} + {%- endfor %} + {{- '<|im_end|>\n' }} + {%- elif message.role == "tool" %} + {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != "tool") %} + {{- '<|im_start|>user' }} + {%- endif %} + {{- '\n\n' }} + {{- message.content }} + {{- '\n' }} + {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %} + {{- '<|im_end|>\n' }} + {%- endif %} + {%- endif %} +{%- endfor %} +{%- if add_generation_prompt %} + {{- '<|im_start|>assistant\n' }} +{%- endif %} diff --git a/merged-fp16/config.json b/merged-fp16/config.json new file mode 100644 index 0000000..95993be --- /dev/null +++ b/merged-fp16/config.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6fe78a0b599d02fd77278e914250efe913a8c51161df270428335540acfd35c +size 1606 diff --git a/merged-fp16/model.safetensors b/merged-fp16/model.safetensors new file mode 100644 index 0000000..d74561a --- /dev/null +++ b/merged-fp16/model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f6ae45953dd2ab26b7d01bb03dcac230f78959ac4999133144203e86c1f8923 +size 3087467144 diff --git a/merged-fp16/tokenizer.json b/merged-fp16/tokenizer.json new file mode 100644 index 0000000..5340d81 --- /dev/null +++ b/merged-fp16/tokenizer.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bd5948af71b4f56cf697f7580814c7ce8b80595ef985544efcacf716126a2e31 +size 11422356 diff --git a/merged-fp16/tokenizer_config.json b/merged-fp16/tokenizer_config.json new file mode 100644 index 0000000..0f7780b --- /dev/null +++ b/merged-fp16/tokenizer_config.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ec2342b980a851bfe1b7c12ad9bc9b4efa9454e7d627b1d3fdcc1a45d6798a25 +size 7240 diff --git a/notebooks/README.md b/notebooks/README.md new file mode 100644 index 0000000..b3bf482 --- /dev/null +++ b/notebooks/README.md @@ -0,0 +1,10 @@ +# Notebooks + +No notebook is required to use the model. + +Optional notebooks can be added later for: + +- loading the LoRA adapter +- converting the merged FP16 model to GGUF +- quantizing GGUF to Q4_K_M +- running a basic PSM Memory inference example diff --git a/training-data/README.md b/training-data/README.md new file mode 100644 index 0000000..f954afe --- /dev/null +++ b/training-data/README.md @@ -0,0 +1,13 @@ +# Training Data + +Training data is not included in this upload bundle yet. + +If synthetic training data is published, include only sanitized data and add: + +- generation method +- schema +- number of examples +- known limitations +- license/usage terms + +Do not upload private user conversations, local memory databases, benchmark output databases, or raw logs.