Instructions to use ngxson/MiniThinky-v2-1B-Llama-3.2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ngxson/MiniThinky-v2-1B-Llama-3.2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ngxson/MiniThinky-v2-1B-Llama-3.2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ngxson/MiniThinky-v2-1B-Llama-3.2") model = AutoModelForCausalLM.from_pretrained("ngxson/MiniThinky-v2-1B-Llama-3.2") 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]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use ngxson/MiniThinky-v2-1B-Llama-3.2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ngxson/MiniThinky-v2-1B-Llama-3.2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ngxson/MiniThinky-v2-1B-Llama-3.2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ngxson/MiniThinky-v2-1B-Llama-3.2
- SGLang
How to use ngxson/MiniThinky-v2-1B-Llama-3.2 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 "ngxson/MiniThinky-v2-1B-Llama-3.2" \ --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": "ngxson/MiniThinky-v2-1B-Llama-3.2", "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 "ngxson/MiniThinky-v2-1B-Llama-3.2" \ --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": "ngxson/MiniThinky-v2-1B-Llama-3.2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ngxson/MiniThinky-v2-1B-Llama-3.2 with Docker Model Runner:
docker model run hf.co/ngxson/MiniThinky-v2-1B-Llama-3.2
MiniThinky 1B
This is the newer checkpoint of MiniThinky-1B-Llama-3.2 (version 1), which the loss decreased from 0.7 to 0.5
Link to GGUF version: click here
Chat template is the same with llama 3, but the response will be as follow:
<|thinking|>{thinking_process}
<|answer|>
{real_answer}
IMPORTANT: System message
The model is very sensitive to system message. Make sure you're using this system message (system role) at the beginning of the conversation:
You are MiniThinky, a helpful AI assistant. You always think before giving the answer. Use <|thinking|> before thinking and <|answer|> before giving the answer.
Q&A
Hardware used to trained it?
I used a HF space with 4xL40S, trained for 5 hours (v1) and an additional of 6 hours (v2)
Benchmark?
I don't have time to do it alone. If you can help, please open a discussion!
Can it count number of "r" in "raspberry"?
Unfortunately no
Other things that I can tune?
Maybe lower temperature, or set top_k=1
TODO: include more info here + maybe do some benchmarks? (Plz add a discussion if you're interested)
- Downloads last month
- 150