Text Generation
Transformers
Safetensors
Chinese
English
qwen3
minimind
tiny-llm
conversational
text-generation-inference
Instructions to use VincentZhu007/minimind-3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use VincentZhu007/minimind-3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="VincentZhu007/minimind-3") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("VincentZhu007/minimind-3") model = AutoModelForCausalLM.from_pretrained("VincentZhu007/minimind-3", device_map="auto") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use VincentZhu007/minimind-3 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "VincentZhu007/minimind-3" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "VincentZhu007/minimind-3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/VincentZhu007/minimind-3
- SGLang
How to use VincentZhu007/minimind-3 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 "VincentZhu007/minimind-3" \ --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": "VincentZhu007/minimind-3", "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 "VincentZhu007/minimind-3" \ --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": "VincentZhu007/minimind-3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use VincentZhu007/minimind-3 with Docker Model Runner:
docker model run hf.co/VincentZhu007/minimind-3
MiniMind-3 (64M)
感谢 MiniMind 原作者 jingyaogong 的贡献。 本仓库的权重是在原作者工作基础上转换而来,并非最原始的 MiniMind 模型权重。 如需访问原始权重,请前往原作者仓库:jingyaogong/minimind-3(HF)/ gongjy/minimind-3(ModelScope)。
MiniMind 是一个仅 64M 参数的超小尺寸中文 LLM,从零手写训练,旨在以极低成本揭示 LLM 的基本原理。 本仓库是官方 PyTorch 权重转换而来的 Transformers / Qwen3 兼容格式,可直接用于推理部署。
- 原始项目:jingyaogong/minimind
- 架构:Qwen3ForCausalLM(dense,8 层,hidden 768,GQA 8/4,tie embeddings)
- 词表:6400(自训练 tokenizer,面向中文)
快速开始
from transformers import AutoModelForCausalLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("minimind-3")
model = AutoModelForCausalLM.from_pretrained("minimind-3")
messages = [{"role": "user", "content": "你好,请介绍一下你自己"}]
prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
inputs = tokenizer(prompt, return_tensors="pt")
# BERT 风格 tokenizer 会返回 token_type_ids,但模型 forward 不接收,generate 会报 ValueError,需移除
inputs.pop("token_type_ids", None)
out = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
模型配置
| 项目 | 值 |
|---|---|
| 参数量 | 63.9M |
| 层数 | 8 |
| hidden_size | 768 |
| attention heads | 8 (KV 4) |
| head_dim | 96 |
| intermediate_size | 2432 |
| max_position_embeddings | 32768 |
| RoPE theta | 1e6 |
| 精度 | float16 |
备注
64M 级别的模型能力有限,主要用于学习 LLM 训练/推理全流程,不适合生产场景的复杂任务。 训练代码、数据集与更多尺寸的权重请见原始仓库。
- Downloads last month
- 29