Text Generation
Transformers
Safetensors
Chinese
English
ynet31
custom_code
ymodel
ymodel31
conversational
Instructions to use SnifferCaptain/ymodel3.1-200m-pt with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SnifferCaptain/ymodel3.1-200m-pt with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SnifferCaptain/ymodel3.1-200m-pt", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("SnifferCaptain/ymodel3.1-200m-pt", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use SnifferCaptain/ymodel3.1-200m-pt with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SnifferCaptain/ymodel3.1-200m-pt" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SnifferCaptain/ymodel3.1-200m-pt", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/SnifferCaptain/ymodel3.1-200m-pt
- SGLang
How to use SnifferCaptain/ymodel3.1-200m-pt 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 "SnifferCaptain/ymodel3.1-200m-pt" \ --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": "SnifferCaptain/ymodel3.1-200m-pt", "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 "SnifferCaptain/ymodel3.1-200m-pt" \ --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": "SnifferCaptain/ymodel3.1-200m-pt", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use SnifferCaptain/ymodel3.1-200m-pt with Docker Model Runner:
docker model run hf.co/SnifferCaptain/ymodel3.1-200m-pt
| license: mit | |
| language: | |
| - zh | |
| - en | |
| pipeline_tag: text-generation | |
| library_name: transformers | |
| tags: | |
| - custom_code | |
| - safetensors | |
| - ymodel | |
| - ymodel31 | |
| # ymodel3.1-200M | |
| `ymodel3.1-200M`是SnifferCaptain训练的到目前为止(7/7/2026)最新、最大的语言模型。采用ynet3.1架构,在ymodel3所使用的ynet3架构上添加了Sengram记忆模块,其模型容量上相比上一代架构有一定的提升。 | |
| ## 模型细节 | |
| - 在ynet3的基础上,添加了Sengram记忆模块,这种稀疏嵌入可以在增大模型参数量的时候,尽可能减少模型的额外计算量。 | |
| - Sengram (Simplified Engram( https://arxiv.org/abs/2601.07372 ))记忆模块对原始的Engram基于n-gram的记忆模块进行了简化,分为掌管稀疏路由的SengramIndexer与掌管嵌入的SengramPLE。 | |
| - 在SengramIndexer记忆选择过程中,相比原来的Engram,它将记忆的选择从简单快速的哈希改为在语义空间内线性投影,而后使用类似MoE的softmax + topk让后续嵌入在语义空间中得到连续的表示。其优点在于它将离散的可碰撞的哈希嵌入转换为在语义空间中连续的嵌入方式,且在建模上不局限于n-gram这种仅语言模型支持的特殊数据,它天生支持多模态。其缺点在于相比简单哈希计算量会大很多,但是整体上来说由于所有层共享一个选择结果,占用模型推理的总计算量很小。 | |
| - SengramPLE的意思是Sengram模块的逐层嵌入(Per-Layer Embedding),模块接收来自Indexer的topk与score输出,在每层独立的分桶内取得逐层嵌入并加权求和。SengramPLE去掉了原本engram对嵌入的gate,选择了直接相加的方式加速计算。 | |
| | 键 | 值 | | |
| | --- | --- | | |
| | 架构 | YModel3.1 | | |
| | 参数数量 | 210.22M | | |
| | 层数 | 12 | | |
| | 隐藏层维度 | 768 | | |
| | 词表大小 | 6400 | | |
| | 注意力头数 | 8 | | |
| | 注意力头维度 | 192 | | |
| | KV嵌入维度 | 256 | | |
| | RoPE嵌入维度 | 64 | | |
| | FFN激活函数 | SwiGLU | | |
| | FFN中间层大小 | 2048 | | |
| | 归一化 | RMSNorm + SEBlock | | |
| | 注意力机制 | MLGA | | |
| | Sengram桶大小 | 8192 | | |
| | Sengram选择数量 | 8 | | |
| | Sengram评分函数 | Softmax | | |
| | 数据类型 | bfloat16 | | |
| ## 训练细节 | |
| - 在预训练阶段,模型在512长度的上下文充分使用**5B tokens**,1e-4带warmup的余弦退火到1e-5的学习率下,完成预训练。最终的ppl为5.041(6400BPE词表长度) | |
| - 模型全程采用与YModel3相同的**SiMuon优化器**训练 | |
| - 模型的tokenlizer与词嵌入层使用的是预训练权重,来自MiniMind3-v( https://github.com/jingyaogong/minimind ) | |
| - 预训练阶段采用的批次大小为前50% 64k tokens/step、后50% 128k tokens/step | |