Instructions to use QuantFactory/Cotype-Nano-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use QuantFactory/Cotype-Nano-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="QuantFactory/Cotype-Nano-GGUF")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("QuantFactory/Cotype-Nano-GGUF", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use QuantFactory/Cotype-Nano-GGUF 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 QuantFactory/Cotype-Nano-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf QuantFactory/Cotype-Nano-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf QuantFactory/Cotype-Nano-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf QuantFactory/Cotype-Nano-GGUF:Q4_K_M
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 QuantFactory/Cotype-Nano-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf QuantFactory/Cotype-Nano-GGUF:Q4_K_M
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 QuantFactory/Cotype-Nano-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf QuantFactory/Cotype-Nano-GGUF:Q4_K_M
Use Docker
docker model run hf.co/QuantFactory/Cotype-Nano-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use QuantFactory/Cotype-Nano-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "QuantFactory/Cotype-Nano-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "QuantFactory/Cotype-Nano-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/QuantFactory/Cotype-Nano-GGUF:Q4_K_M
- SGLang
How to use QuantFactory/Cotype-Nano-GGUF 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 "QuantFactory/Cotype-Nano-GGUF" \ --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": "QuantFactory/Cotype-Nano-GGUF", "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 "QuantFactory/Cotype-Nano-GGUF" \ --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": "QuantFactory/Cotype-Nano-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use QuantFactory/Cotype-Nano-GGUF with Ollama:
ollama run hf.co/QuantFactory/Cotype-Nano-GGUF:Q4_K_M
- Unsloth Desktop
- Pi
How to use QuantFactory/Cotype-Nano-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf QuantFactory/Cotype-Nano-GGUF:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "QuantFactory/Cotype-Nano-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use QuantFactory/Cotype-Nano-GGUF with Docker Model Runner:
docker model run hf.co/QuantFactory/Cotype-Nano-GGUF:Q4_K_M
- Lemonade
How to use QuantFactory/Cotype-Nano-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull QuantFactory/Cotype-Nano-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Cotype-Nano-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use QuantFactory/Cotype-Nano-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf QuantFactory/Cotype-Nano-GGUF:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default QuantFactory/Cotype-Nano-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use QuantFactory/Cotype-Nano-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf QuantFactory/Cotype-Nano-GGUF:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "QuantFactory/Cotype-Nano-GGUF:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
QuantFactory/Cotype-Nano-GGUF
This is quantized version of MTSAIR/Cotype-Nano created using llama.cpp
Original Model Card
Cotype-Nano๐ค
MTSAIR/Cotype-Nano โ ััะพ ะปะตะณะบะพะฒะตัะฝะฐั LLM, ัะฐะทัะฐะฑะพัะฐะฝะฝะฐั ะดะปั ะฒัะฟะพะปะฝะตะฝะธั ะทะฐะดะฐั ั ะผะธะฝะธะผะฐะปัะฝัะผะธ ัะตััััะฐะผะธ. ะะฝะฐ ะพะฟัะธะผะธะทะธัะพะฒะฐะฝะฐ ะดะปั ะฑััััะพะณะพ ะธ ัััะตะบัะธะฒะฝะพะณะพ ะฒะทะฐะธะผะพะดะตะนััะฒะธั ั ะฟะพะปัะทะพะฒะฐัะตะปัะผะธ, ะพะฑะตัะฟะตัะธะฒะฐั ะฒััะพะบัั ะฟัะพะธะทะฒะพะดะธัะตะปัะฝะพััั ะดะฐะถะต ะฒ ััะปะพะฒะธัั ะพะณัะฐะฝะธัะตะฝะฝัั ัะตััััะพะฒ.
Cotype Nano is a lightweight LLM, designed to perform tasks with minimal resources. It is optimized for fast and efficient interaction with users, providing high performance even under resource-constrained conditions.
Inference with vLLM
python3 -m vllm.entrypoints.openai.api_server --model MTSAIR/Cotype-Nano --port 8000
Recommended generation parameters and system prompt
import openai
import pandas as pd
from tqdm import tqdm
openai.api_key = 'xxx'
endpoint = 'http://localhost:8000/v1'
model = 'MTSAIR/Cotype-Nano'
openai.api_base = endpoint
# Possible system prompt:
# {"role": "system", "content": "ะขั โ ะะ-ะฟะพะผะพัะฝะธะบ. ะขะตะฑะต ะดะฐะฝะพ ะทะฐะดะฐะฝะธะต: ะฝะตะพะฑั
ะพะดะธะผะพ ัะณะตะฝะตัะธัะพะฒะฐัั ะฟะพะดัะพะฑะฝัะน ะธ ัะฐะทะฒะตัะฝัััะน ะพัะฒะตั."},
response = openai.ChatCompletion.create(
model=model,
temperature=0.4, # 0.0 is also allowed
frequency_penalty=0.0,
max_tokens=2048,
top_p=0.8, # 0.1 is also allowed
messages=[
{"role": "user", "content": "ะะฐะบ ะผะฝะต ะพะฑััะธัั ะผะพะดะตะปั meta-llama/Llama-3.2-1B ั ะฟะพะผะพััั ะฑะธะฑะปะธะพัะตะบะธ transformers?"}
]
)
answer = response["choices"][0]["message"]["content"]
print(answer)
Inference with Huggingface
from transformers import pipeline
pipe = pipeline("text-generation", model="MTSAIR/Cotype-Nano", device="cuda")
messages = [
{"role": "system", "content": "ะขั โ ะะ-ะฟะพะผะพัะฝะธะบ. ะขะตะฑะต ะดะฐะฝะพ ะทะฐะดะฐะฝะธะต: ะฝะตะพะฑั
ะพะดะธะผะพ ัะณะตะฝะตัะธัะพะฒะฐัั ะฟะพะดัะพะฑะฝัะน ะธ ัะฐะทะฒะตัะฝัััะน ะพัะฒะตั."},
{"role": "user", "content": "ะ ะฐััะบะฐะถะธ ะผะฝะต ะฟัะพ ะะ"},
]
res = pipe(messages, max_length=1024)
print(res[0]['generated_text'][-1]['content'])
Example request
Request: ะะฐะฟะธัะธ ะฟัะพััะพะน ัะตัะฒะตั ะฝะฐ ัะฐััะฐะฟะธ
Cotype-Nano response:
ะคะฐััะฐะฟะธ (FastAPI) โ ััะพ ัะพะฒัะตะผะตะฝะฝัะน ััะตะนะผะฒะพัะบ ะดะปั ัะพะทะดะฐะฝะธั ะฒะตะฑ-ัะตัะฒะธัะพะฒ ะฝะฐ ัะทัะบะต Python, ะบะพัะพััะน ะธัะฟะพะปัะทัะตั ะฐัะธะฝั ัะพะฝะฝัะน ัะธะฝัะฐะบัะธั ะธ ะฟะพะดะดะตัะถะธะฒะฐะตั ะณะตะฝะตัะฐัะพัั. ะะฝ ะฟะพะดั ะพะดะธั ะดะปั ัะพะทะดะฐะฝะธั ัะปะพะถะฝัั ะฒะตะฑ-ะฟัะธะปะพะถะตะฝะธะน ะธ ัะฐััะพ ะธัะฟะพะปัะทัะตััั ะฒ ัะพัะตัะฐะฝะธะธ ั ะฑะฐะทะพะน ะดะฐะฝะฝัั .
ะะปั ัะพะทะดะฐะฝะธั ะฟัะพััะพะณะพ ัะตัะฒะตัะฐ ะฝะฐ ัะฐััะฐะฟะธ, ะฒะฐะผ ะฟะพะฝะฐะดะพะฑะธััั:
- ะฃััะฐะฝะพะฒะธัั ัะฐััะฐะฟะธ ะธ ะฝะตะพะฑั ะพะดะธะผัะต ะฑะธะฑะปะธะพัะตะบะธ.
- ะกะพะทะดะฐัั ะฑะฐะทะพะฒัะน ะบะปะฐัั
Appะดะปั ะฝะฐัััะพะนะบะธ ัะตัะฒะตัะฐ.- ะ ะตะฐะปะธะทะพะฒะฐัั ะผะฐัััััั ะธ ะพะฑัะฐะฑะพััะธะบะธ ะดะปั ะฒะฐัะตะณะพ ะฒะตะฑ-ะฟัะธะปะพะถะตะฝะธั.
ะจะฐะณ 1: ะฃััะฐะฝะพะฒะบะฐ ัะฐััะฐะฟะธ ะธ ะฝะตะพะฑั ะพะดะธะผัั ะฑะธะฑะปะธะพัะตะบ
ะะปั ะฝะฐัะฐะปะฐ ัััะฐะฝะพะฒะธัะต ัะฐััะฐะฟะธ ะธ ะดััะณะธะต ะฝะตะพะฑั ะพะดะธะผัะต ะฑะธะฑะปะธะพัะตะบะธ, ัะฐะบะธะต ะบะฐะบ
uvicornะดะปั ะทะฐะฟััะบะฐ ัะตัะฒะตัะฐ:pip install fastapi uvicornะจะฐะณ 2: ะกะพะทะดะฐะฝะธะต ะบะปะฐััะฐ
Appะกะพะทะดะฐะนัะต ะบะปะฐัั
App, ะบะพัะพััะน ะฑัะดะตั ะฝะฐัััะฐะธะฒะฐัั ัะตัะฒะตั:from fastapi import FastAPI app = FastAPI()ะจะฐะณ 3: ะ ะตะฐะปะธะทะฐัะธั ะผะฐัััััะพะฒ
ะะพะฑะฐะฒััะต ะผะฐัััััั ะธ ะพะฑัะฐะฑะพััะธะบะธ ะดะปั ะฒะฐัะตะณะพ ะฒะตะฑ-ะฟัะธะปะพะถะตะฝะธั. ะะฐะฟัะธะผะตั, ัะพะทะดะฐะดะธะผ ะฟัะพััะพะน endpoint ะดะปั ะพัะฒะตัะฐ ะฝะฐ GET-ะทะฐะฟัะพัั:
@app.get("/") async def read_root(): return {"message": "Hello, FastAPI!"}ะจะฐะณ 4: ะะฐะฟััะบ ัะตัะฒะตัะฐ
ะัะฟะพะปัะทัะนัะต
uvicornะดะปั ะทะฐะฟััะบะฐ ัะตัะฒะตัะฐ:uvicorn main:app --reloadะะดะตัั
mainโ ััะพ ะธะผั ัะฐะนะปะฐ ั ะฒะฐัะธะผ ะบะพะดะพะผ, ะฐappโ ััะพ ัะบะทะตะผะฟะปัั ะบะปะฐััะฐApp, ะบะพัะพััะน ะฒั ัะพะทะดะฐะปะธ ัะฐะฝะตะต.
--reloadัะบะฐะทัะฒะฐะตัuvicornะฟะตัะตะทะฐะณััะถะฐัั ัะตัะฒะตั ะฟัะธ ะธะทะผะตะฝะตะฝะธะธ ะบะพะดะฐ.ะขะตะฟะตัั, ะบะพะณะดะฐ ะฒั ะทะฐะฟัััะธัะต ัะตัะฒะตั, ะพะฝ ะฑัะดะตั ะดะพัััะฟะตะฝ ะฟะพ ะฐะดัะตัั
http://127.0.0.1:8000. ะั ะผะพะถะตัะต ะพัะฟัะฐะฒะธัั GET-ะทะฐะฟัะพั ะฝะฐ/ะธ ัะฒะธะดะตัั ะพัะฒะตั:{ "message": "Hello, FastAPI!" }ะญัะพ ะฑะฐะทะพะฒัะน ะฟัะธะผะตั ัะพะณะพ, ะบะฐะบ ะผะพะถะฝะพ ัะพะทะดะฐัั ะฟัะพััะพะน ัะตัะฒะตั ะฝะฐ ัะฐััะฐะฟะธ. ะั ะผะพะถะตัะต ัะฐััะธัััั ะธ ะผะพะดะธัะธัะธัะพะฒะฐัั ะตะณะพ, ะดะพะฑะฐะฒะปัั ะฝะพะฒัะต ะผะฐัััััั, ะพะฑัะฐะฑะพััะธะบะธ ะธ ััะฝะบัะธะพะฝะฐะปัะฝะพััั ะฒ ัะพะพัะฒะตัััะฒะธะธ ั ะฒะฐัะธะผะธ ััะตะฑะพะฒะฐะฝะธัะผะธ.
Training process
The model was trained in two stages. In the first stage, MLP layers were trained on mathematics and code. In the second stage, the entire model was trained on internal and open synthetic instructional datasets.
ru-llm-arena: 30.2 (local measurement)
| Model | Score | 95% CI | Avg. #Tokens |
|---|---|---|---|
| Cotype-Nano | 30.2 | +2.2 / -1.3 | 542 |
| vikhr-it-5.3-fp16-32k | 27.8 | +1.5 / -2.1 | 519.71 |
| vikhr-it-5.3-fp16 | 22.73 | +1.8 / -1.7 | 523.45 |
| Cotype-Nano-4bit | 22.5 | +2.1 / -1.4 | 582 |
| kolibri-vikhr-mistral-0427 | 22.41 | +1.6 / -1.9 | 489.89 |
| snorkel-mistral-pairrm-dpo | 22.41 | +1.7 / -1.6 | 773.8 |
| storm-7b | 20.62 | +1.4 / -1.6 | 419.32 |
| neural-chat-7b-v3-3 | 19.04 | +1.8 / -1.5 | 927.21 |
| Vikhrmodels-Vikhr-Llama-3.2-1B-instruct | 19.04 | +1.2 / -1.5 | 958.63 |
| gigachat_lite | 17.2 | +1.5 / -1.5 | 276.81 |
| Vikhrmodels-Vikhr-Qwen-2.5-0.5b-Instruct | 16.5 | +1.5 / -1.7 | 583.5 |
| Qwen-Qwen2.5-1.5B-Instruct | 16.46 | +1.3 / -1.3 | 483.67 |
| Vikhrmodels-vikhr-qwen-1.5b-it | 13.19 | +1.3 / -1.1 | 2495.38 |
| meta-llama-Llama-3.2-1B-Instruct | 4.04 | +0.6 / -0.8 | 1240.53 |
| Qwen-Qwen2.5-0.5B-Instruct | 4.02 | +0.7 / -0.8 | 829.87 |
- Downloads last month
- 11,194
2-bit
3-bit
4-bit
5-bit
6-bit
8-bit