Instructions to use Convergent-ch/Pico-1.3-Math with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Convergent-ch/Pico-1.3-Math with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Convergent-ch/Pico-1.3-Math") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Convergent-ch/Pico-1.3-Math") model = AutoModelForCausalLM.from_pretrained("Convergent-ch/Pico-1.3-Math", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Convergent-ch/Pico-1.3-Math with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Convergent-ch/Pico-1.3-Math # Run inference directly in the terminal: llama cli -hf Convergent-ch/Pico-1.3-Math
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Convergent-ch/Pico-1.3-Math # Run inference directly in the terminal: llama cli -hf Convergent-ch/Pico-1.3-Math
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Convergent-ch/Pico-1.3-Math # Run inference directly in the terminal: ./llama-cli -hf Convergent-ch/Pico-1.3-Math
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Convergent-ch/Pico-1.3-Math # Run inference directly in the terminal: ./build/bin/llama-cli -hf Convergent-ch/Pico-1.3-Math
Use Docker
docker model run hf.co/Convergent-ch/Pico-1.3-Math
- LM Studio
- Jan
- vLLM
How to use Convergent-ch/Pico-1.3-Math with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Convergent-ch/Pico-1.3-Math" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Convergent-ch/Pico-1.3-Math", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Convergent-ch/Pico-1.3-Math
- SGLang
How to use Convergent-ch/Pico-1.3-Math 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 "Convergent-ch/Pico-1.3-Math" \ --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": "Convergent-ch/Pico-1.3-Math", "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 "Convergent-ch/Pico-1.3-Math" \ --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": "Convergent-ch/Pico-1.3-Math", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use Convergent-ch/Pico-1.3-Math with Ollama:
ollama run hf.co/Convergent-ch/Pico-1.3-Math
- Unsloth Desktop
- Docker Model Runner
How to use Convergent-ch/Pico-1.3-Math with Docker Model Runner:
docker model run hf.co/Convergent-ch/Pico-1.3-Math
- Lemonade
How to use Convergent-ch/Pico-1.3-Math with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Convergent-ch/Pico-1.3-Math
Run and chat with the model
lemonade run user.Pico-1.3-Math-{{QUANT_TAG}}List all available models
lemonade list
- Atomic Chat
Pico 1.3-Math
Pico 1.3-Math is an 8.1M-parameter model made by Convergent that solves arithmetic and easy English word problems step by step. It was trained from scratch, with random initialization, on synthetic problems whose every step was computed by Python.
It is a specialist. It does math within the range it was trained on (numbers up to 4 digits) very reliably, and it fails outside that range. It does not chat.
Quick start
Ollama
ollama create pico1.3-math -f Modelfile
ollama run pico1.3-math "What is 347 * 26?"
Use the Modelfile from this repository. It sets the chat template, temperature 0 and repeat_penalty 1.0. A repeat penalty would break the step-by-step solutions, because they repeat numbers on purpose.
Transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("Convergent-ch/Pico-1.3-Math")
model = AutoModelForCausalLM.from_pretrained("Convergent-ch/Pico-1.3-Math")
msgs = [{"role": "user", "content": "What is 23 * 17?"}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt", return_dict=True)["input_ids"]
out = model.generate(ids, max_new_tokens=900, do_sample=False)
print(tok.decode(out[0][ids.shape[1]:], skip_special_tokens=True))
Example
User: Tom has 45 apples and gets 38 more. How many apples does Tom have now?
Tom gets more, so add: 45 + 38.
45 + 38 = 45 + 30 + 8
45 + 30 = 75
75 + 8 = 83
Answer: 83 apples
Every solution ends with a line Answer: ....
What it can do
- Addition and subtraction with numbers up to 4 digits, including negative results.
- Multiplication up to 4 digits × 1 digit, 3 digits × 2 digits and 2 digits × 2 digits.
- Division by 2 to 25, exact or with remainder.
- Expressions with two operations, with and without brackets (order of operations).
- Percentages such as "15% of 240" when the result is a whole number.
- Easy English word problems: giving and getting items, totals, groups, sharing, prices, differences, two-step problems, distance = speed × time.
- Input as symbols (
*,x,×,/,÷) or words ("plus", "times", "divided by").
The method: every solution is broken down into small steps. The only operations done in one line are adding or subtracting a number with a single non-zero digit (5028 + 60), multiplying two single digits with trailing zeros (300 * 6 = 1800), and multiplying or dividing by 10, 100 or 1000. The tokenizer keeps every digit as its own token.
Evaluation
Held-out test with 420 new problems, decoded greedily in Ollama. No training example uses the same numbers as a test problem.
| Problem type | Correct | Accuracy |
|---|---|---|
| Addition | 61 / 61 | 100 % |
| Subtraction | 60 / 61 | 98.4 % |
| Multiplication | 61 / 61 | 100 % |
| Division | 61 / 61 | 100 % |
| Order of operations | 61 / 61 | 100 % |
| Percent | 54 / 54 | 100 % |
| Word problems | 61 / 61 | 100 % |
| Total (training range) | 419 / 420 | 99.8 % |
| Beyond range: 5-digit addition | 0 / 20 | 0 % |
| Beyond range: 3 × 3-digit multiplication | 0 / 20 | 0 % |
The test problems come from the same generator as the training data, only with different numbers. The high score therefore shows that the model learned the procedure for this kind of problem. It does not show general math ability.
The one subtraction error: for 2163 − 2189 the model did not notice that the result is negative and answered 74 instead of −26.
Validation on held-out training-style data: loss 0.0176, token accuracy 99.4 %.
Limitations
- Number range: with 5-digit numbers the model drops a digit and answers wrong. With two 3-digit factors it loops ("375 * 671 = 671 * 375" over and over) until the output limit, because this case never appeared in training.
- No decimals, fractions, powers, roots or algebra.
- Word problems only work in the trained patterns (see above). Other wording or other situations will often fail.
- English only, and no chat. Other questions get a short reply that it only does math.
- Answers are long, because every step is written out.
Training
- Architecture: Llama-style decoder, 8 layers, hidden size 288, MLP 768 (SwiGLU), 6 heads, RoPE, RMSNorm, context 1024, tied embeddings. 8,114,976 parameters.
- Tokenizer: byte-level BPE with 512 entries. All merges that would combine digits were removed, so
4728is always the four tokens4 7 2 8. - Data: 800,000 synthetic problems, about 45M tokens, mix of 14 % addition, 12 % subtraction, 22 % multiplication, 14 % division, 12 % order of operations, 6 % percent, 18 % word problems and 2 % identity / off-topic replies.
- Training: 9,000 steps of about 32K tokens (about 6.5 passes over the data), AdamW, learning rate 1e-3 with cosine decay, bf16, on one RTX 3060 Ti in about 40 minutes with MakeAI.
License
Apache 2.0.
- Downloads last month
- 40