Text Generation
Transformers
Safetensors
GGUF
Russian
English
qwen3
russian
chat
assistant
on-device
mnn
work-in-progress
conversational
text-generation-inference
Instructions to use Rahspide/MNN-Pocket-0.3B-RU-Chat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Rahspide/MNN-Pocket-0.3B-RU-Chat with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Rahspide/MNN-Pocket-0.3B-RU-Chat") 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("Rahspide/MNN-Pocket-0.3B-RU-Chat") model = AutoModelForCausalLM.from_pretrained("Rahspide/MNN-Pocket-0.3B-RU-Chat", 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 Rahspide/MNN-Pocket-0.3B-RU-Chat 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 Rahspide/MNN-Pocket-0.3B-RU-Chat:Q4_K_M # Run inference directly in the terminal: llama cli -hf Rahspide/MNN-Pocket-0.3B-RU-Chat:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Rahspide/MNN-Pocket-0.3B-RU-Chat:Q4_K_M # Run inference directly in the terminal: llama cli -hf Rahspide/MNN-Pocket-0.3B-RU-Chat:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf Rahspide/MNN-Pocket-0.3B-RU-Chat:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf Rahspide/MNN-Pocket-0.3B-RU-Chat:Q4_K_M
Use Docker
docker model run hf.co/Rahspide/MNN-Pocket-0.3B-RU-Chat:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use Rahspide/MNN-Pocket-0.3B-RU-Chat with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Rahspide/MNN-Pocket-0.3B-RU-Chat" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Rahspide/MNN-Pocket-0.3B-RU-Chat", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Rahspide/MNN-Pocket-0.3B-RU-Chat:Q4_K_M
- SGLang
How to use Rahspide/MNN-Pocket-0.3B-RU-Chat 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 "Rahspide/MNN-Pocket-0.3B-RU-Chat" \ --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": "Rahspide/MNN-Pocket-0.3B-RU-Chat", "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 "Rahspide/MNN-Pocket-0.3B-RU-Chat" \ --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": "Rahspide/MNN-Pocket-0.3B-RU-Chat", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use Rahspide/MNN-Pocket-0.3B-RU-Chat with Ollama:
ollama run hf.co/Rahspide/MNN-Pocket-0.3B-RU-Chat:Q4_K_M
- Unsloth Desktop
- Pi
How to use Rahspide/MNN-Pocket-0.3B-RU-Chat with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Rahspide/MNN-Pocket-0.3B-RU-Chat: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": "Rahspide/MNN-Pocket-0.3B-RU-Chat:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use Rahspide/MNN-Pocket-0.3B-RU-Chat with Docker Model Runner:
docker model run hf.co/Rahspide/MNN-Pocket-0.3B-RU-Chat:Q4_K_M
- Lemonade
How to use Rahspide/MNN-Pocket-0.3B-RU-Chat with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Rahspide/MNN-Pocket-0.3B-RU-Chat:Q4_K_M
Run and chat with the model
lemonade run user.MNN-Pocket-0.3B-RU-Chat-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use Rahspide/MNN-Pocket-0.3B-RU-Chat with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Rahspide/MNN-Pocket-0.3B-RU-Chat: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 Rahspide/MNN-Pocket-0.3B-RU-Chat:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Rahspide/MNN-Pocket-0.3B-RU-Chat with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Rahspide/MNN-Pocket-0.3B-RU-Chat: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 "Rahspide/MNN-Pocket-0.3B-RU-Chat: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"
mnn: INT4 weights for the MNN runtime
Browse files
.gitattributes
CHANGED
|
@@ -36,3 +36,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 36 |
gguf/MNN-Pocket-0.3B-RU-Chat-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
|
| 37 |
gguf/MNN-Pocket-0.3B-RU-Chat-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
| 38 |
assets/cover_chat.png filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
gguf/MNN-Pocket-0.3B-RU-Chat-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
|
| 37 |
gguf/MNN-Pocket-0.3B-RU-Chat-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
| 38 |
assets/cover_chat.png filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
mnn/MNN-Pocket-0.3B-RU-Chat-INT4/llm.mnn filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
mnn/MNN-Pocket-0.3B-RU-Chat-INT4/llm.mnn.weight filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
mnn/MNN-Pocket-0.3B-RU-Chat-INT4/tokenizer.mtok filter=lfs diff=lfs merge=lfs -text
|
mnn/MNN-Pocket-0.3B-RU-Chat-INT4/config.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"llm_model": "llm.mnn",
|
| 3 |
+
"llm_weight": "llm.mnn.weight",
|
| 4 |
+
"backend_type": "cpu",
|
| 5 |
+
"thread_num": 4,
|
| 6 |
+
"precision": "low",
|
| 7 |
+
"memory": "low",
|
| 8 |
+
"sampler_type": "mixed",
|
| 9 |
+
"temperature": 0.8,
|
| 10 |
+
"top_k": 40,
|
| 11 |
+
"top_p": 0.9,
|
| 12 |
+
"min_p": 0.05,
|
| 13 |
+
"tfs_z": 1.0,
|
| 14 |
+
"typical": 0.95,
|
| 15 |
+
"repetition_penalty": 1.0,
|
| 16 |
+
"presence_penalty": 0.0,
|
| 17 |
+
"frequency_penalty": 0.0,
|
| 18 |
+
"penalty_window": 0,
|
| 19 |
+
"n_gram": 8,
|
| 20 |
+
"ngram_factor": 1.0,
|
| 21 |
+
"tokenizer_file": "tokenizer.mtok"
|
| 22 |
+
}
|
mnn/MNN-Pocket-0.3B-RU-Chat-INT4/llm.mnn
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4b701fa523183db03ea009943f173620ff6aea5c14457afa74261e4511877375
|
| 3 |
+
size 725608
|
mnn/MNN-Pocket-0.3B-RU-Chat-INT4/llm.mnn.weight
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:52e7afc4145660cfac20fc50e4747a1f77402377e745bad5fe6e8983ef7bd18c
|
| 3 |
+
size 170724594
|
mnn/MNN-Pocket-0.3B-RU-Chat-INT4/llm_config.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_type": "qwen3",
|
| 3 |
+
"hidden_size": 896,
|
| 4 |
+
"layer_nums": 28,
|
| 5 |
+
"attention_mask": "float",
|
| 6 |
+
"attention_type": "full",
|
| 7 |
+
"is_mrope": false,
|
| 8 |
+
"max_position_embeddings": 40960,
|
| 9 |
+
"jinja": {
|
| 10 |
+
"chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0].role == 'system' %}\n {{- messages[0].content + '\\n\\n' }}\n {%- endif %}\n {{- \"# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0].role == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0].content + '<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- for message in messages %}\n {%- if message.content is string %}\n {%- set content = message.content %}\n {%- else %}\n {%- set content = '' %}\n {%- endif %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) %}\n {{- '<|im_start|>' + message.role + '\\n' + content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- if message.tool_calls %}\n {%- for tool_call in message.tool_calls %}\n {%- if (loop.first and content) or (not loop.first) %}\n {{- '\\n' }}\n {%- endif %}\n {%- if tool_call.function %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {%- if tool_call.arguments is string %}\n {{- tool_call.arguments }}\n {%- else %}\n {{- tool_call.arguments | tojson }}\n {%- endif %}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.first or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n{%- endif %}",
|
| 11 |
+
"eos": "<|im_end|>"
|
| 12 |
+
},
|
| 13 |
+
"tie_embeddings": {
|
| 14 |
+
"weight_offset": 137694450,
|
| 15 |
+
"alpha_offset": 167054578,
|
| 16 |
+
"alpha_size": 3670016,
|
| 17 |
+
"quant_bit": 4,
|
| 18 |
+
"quant_block": 64,
|
| 19 |
+
"alpha_dtype": "fp16"
|
| 20 |
+
}
|
| 21 |
+
}
|
mnn/MNN-Pocket-0.3B-RU-Chat-INT4/tokenizer.mtok
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:94e81007f6a83ea8da0b1ae4bda5fb79fef6941e246dd653354f1461e66186b8
|
| 3 |
+
size 1710857
|