Text Generation
PEFT
Safetensors
GGUF
Korean
English
function-calling
tool-use
korean
qlora
conversational
Instructions to use mengbau/toolRouter-1B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use mengbau/toolRouter-1B with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/llama-3.2-1b-instruct-unsloth-bnb-4bit") model = PeftModel.from_pretrained(base_model, "mengbau/toolRouter-1B") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use mengbau/toolRouter-1B 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 mengbau/toolRouter-1B:Q4_K_M # Run inference directly in the terminal: llama cli -hf mengbau/toolRouter-1B:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf mengbau/toolRouter-1B:Q4_K_M # Run inference directly in the terminal: llama cli -hf mengbau/toolRouter-1B: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 mengbau/toolRouter-1B:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf mengbau/toolRouter-1B: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 mengbau/toolRouter-1B:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf mengbau/toolRouter-1B:Q4_K_M
Use Docker
docker model run hf.co/mengbau/toolRouter-1B:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use mengbau/toolRouter-1B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mengbau/toolRouter-1B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mengbau/toolRouter-1B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mengbau/toolRouter-1B:Q4_K_M
- Ollama
How to use mengbau/toolRouter-1B with Ollama:
ollama run hf.co/mengbau/toolRouter-1B:Q4_K_M
- Unsloth Desktop
- Pi
How to use mengbau/toolRouter-1B with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf mengbau/toolRouter-1B: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": "mengbau/toolRouter-1B:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use mengbau/toolRouter-1B with Docker Model Runner:
docker model run hf.co/mengbau/toolRouter-1B:Q4_K_M
- Lemonade
How to use mengbau/toolRouter-1B with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull mengbau/toolRouter-1B:Q4_K_M
Run and chat with the model
lemonade run user.toolRouter-1B-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use mengbau/toolRouter-1B with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf mengbau/toolRouter-1B: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 mengbau/toolRouter-1B:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use mengbau/toolRouter-1B with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf mengbau/toolRouter-1B: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 "mengbau/toolRouter-1B: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"
kimjaegeun commited on
docs: model card (2026-09 Korean-enhanced release)
Browse files
README.md
CHANGED
|
@@ -1,208 +1,52 @@
|
|
| 1 |
---
|
| 2 |
-
base_model:
|
|
|
|
|
|
|
|
|
|
| 3 |
library_name: peft
|
| 4 |
pipeline_tag: text-generation
|
| 5 |
tags:
|
| 6 |
-
-
|
| 7 |
-
-
|
| 8 |
-
-
|
| 9 |
-
-
|
| 10 |
---
|
| 11 |
|
| 12 |
-
#
|
| 13 |
|
| 14 |
-
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
|
|
|
| 17 |
|
| 18 |
-
|
| 19 |
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
-
|
| 23 |
|
|
|
|
|
|
|
|
|
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
-
|
| 27 |
-
- **Funded by [optional]:** [More Information Needed]
|
| 28 |
-
- **Shared by [optional]:** [More Information Needed]
|
| 29 |
-
- **Model type:** [More Information Needed]
|
| 30 |
-
- **Language(s) (NLP):** [More Information Needed]
|
| 31 |
-
- **License:** [More Information Needed]
|
| 32 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
| 33 |
|
| 34 |
-
##
|
| 35 |
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
-
|
| 39 |
-
- **Paper [optional]:** [More Information Needed]
|
| 40 |
-
- **Demo [optional]:** [More Information Needed]
|
| 41 |
-
|
| 42 |
-
## Uses
|
| 43 |
-
|
| 44 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
| 45 |
-
|
| 46 |
-
### Direct Use
|
| 47 |
-
|
| 48 |
-
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
| 49 |
-
|
| 50 |
-
[More Information Needed]
|
| 51 |
-
|
| 52 |
-
### Downstream Use [optional]
|
| 53 |
-
|
| 54 |
-
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
| 55 |
-
|
| 56 |
-
[More Information Needed]
|
| 57 |
-
|
| 58 |
-
### Out-of-Scope Use
|
| 59 |
-
|
| 60 |
-
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
| 61 |
-
|
| 62 |
-
[More Information Needed]
|
| 63 |
-
|
| 64 |
-
## Bias, Risks, and Limitations
|
| 65 |
-
|
| 66 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
| 67 |
-
|
| 68 |
-
[More Information Needed]
|
| 69 |
-
|
| 70 |
-
### Recommendations
|
| 71 |
-
|
| 72 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
| 73 |
-
|
| 74 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
| 75 |
-
|
| 76 |
-
## How to Get Started with the Model
|
| 77 |
-
|
| 78 |
-
Use the code below to get started with the model.
|
| 79 |
-
|
| 80 |
-
[More Information Needed]
|
| 81 |
-
|
| 82 |
-
## Training Details
|
| 83 |
-
|
| 84 |
-
### Training Data
|
| 85 |
-
|
| 86 |
-
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
| 87 |
-
|
| 88 |
-
[More Information Needed]
|
| 89 |
-
|
| 90 |
-
### Training Procedure
|
| 91 |
-
|
| 92 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
| 93 |
-
|
| 94 |
-
#### Preprocessing [optional]
|
| 95 |
-
|
| 96 |
-
[More Information Needed]
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
#### Training Hyperparameters
|
| 100 |
-
|
| 101 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
| 102 |
-
|
| 103 |
-
#### Speeds, Sizes, Times [optional]
|
| 104 |
-
|
| 105 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
| 106 |
-
|
| 107 |
-
[More Information Needed]
|
| 108 |
-
|
| 109 |
-
## Evaluation
|
| 110 |
-
|
| 111 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
| 112 |
-
|
| 113 |
-
### Testing Data, Factors & Metrics
|
| 114 |
-
|
| 115 |
-
#### Testing Data
|
| 116 |
-
|
| 117 |
-
<!-- This should link to a Dataset Card if possible. -->
|
| 118 |
-
|
| 119 |
-
[More Information Needed]
|
| 120 |
-
|
| 121 |
-
#### Factors
|
| 122 |
-
|
| 123 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
| 124 |
-
|
| 125 |
-
[More Information Needed]
|
| 126 |
-
|
| 127 |
-
#### Metrics
|
| 128 |
-
|
| 129 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
| 130 |
-
|
| 131 |
-
[More Information Needed]
|
| 132 |
-
|
| 133 |
-
### Results
|
| 134 |
-
|
| 135 |
-
[More Information Needed]
|
| 136 |
-
|
| 137 |
-
#### Summary
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
## Model Examination [optional]
|
| 142 |
-
|
| 143 |
-
<!-- Relevant interpretability work for the model goes here -->
|
| 144 |
-
|
| 145 |
-
[More Information Needed]
|
| 146 |
-
|
| 147 |
-
## Environmental Impact
|
| 148 |
-
|
| 149 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
| 150 |
-
|
| 151 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
| 152 |
-
|
| 153 |
-
- **Hardware Type:** [More Information Needed]
|
| 154 |
-
- **Hours used:** [More Information Needed]
|
| 155 |
-
- **Cloud Provider:** [More Information Needed]
|
| 156 |
-
- **Compute Region:** [More Information Needed]
|
| 157 |
-
- **Carbon Emitted:** [More Information Needed]
|
| 158 |
-
|
| 159 |
-
## Technical Specifications [optional]
|
| 160 |
-
|
| 161 |
-
### Model Architecture and Objective
|
| 162 |
-
|
| 163 |
-
[More Information Needed]
|
| 164 |
-
|
| 165 |
-
### Compute Infrastructure
|
| 166 |
-
|
| 167 |
-
[More Information Needed]
|
| 168 |
-
|
| 169 |
-
#### Hardware
|
| 170 |
-
|
| 171 |
-
[More Information Needed]
|
| 172 |
-
|
| 173 |
-
#### Software
|
| 174 |
-
|
| 175 |
-
[More Information Needed]
|
| 176 |
-
|
| 177 |
-
## Citation [optional]
|
| 178 |
-
|
| 179 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
| 180 |
-
|
| 181 |
-
**BibTeX:**
|
| 182 |
-
|
| 183 |
-
[More Information Needed]
|
| 184 |
-
|
| 185 |
-
**APA:**
|
| 186 |
-
|
| 187 |
-
[More Information Needed]
|
| 188 |
-
|
| 189 |
-
## Glossary [optional]
|
| 190 |
-
|
| 191 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
| 192 |
-
|
| 193 |
-
[More Information Needed]
|
| 194 |
-
|
| 195 |
-
## More Information [optional]
|
| 196 |
-
|
| 197 |
-
[More Information Needed]
|
| 198 |
-
|
| 199 |
-
## Model Card Authors [optional]
|
| 200 |
-
|
| 201 |
-
[More Information Needed]
|
| 202 |
-
|
| 203 |
-
## Model Card Contact
|
| 204 |
-
|
| 205 |
-
[More Information Needed]
|
| 206 |
-
### Framework versions
|
| 207 |
-
|
| 208 |
-
- PEFT 0.20.0
|
|
|
|
| 1 |
---
|
| 2 |
+
base_model: meta-llama/Llama-3.2-1B-Instruct
|
| 3 |
+
language:
|
| 4 |
+
- ko
|
| 5 |
+
- en
|
| 6 |
library_name: peft
|
| 7 |
pipeline_tag: text-generation
|
| 8 |
tags:
|
| 9 |
+
- function-calling
|
| 10 |
+
- tool-use
|
| 11 |
+
- korean
|
| 12 |
+
- qlora
|
| 13 |
---
|
| 14 |
|
| 15 |
+
# toolRouter
|
| 16 |
|
| 17 |
+
한국어 우선 **툴콜 라우터** — 사용자 발화를 받아 항상 툴콜 하나로 응답하는 경량(1B) 라우팅 모델의 QLoRA 어댑터입니다.
|
| 18 |
|
| 19 |
+
- 자유 텍스트를 생성하지 않습니다. 모든 출력은 `<tool_call>{"name": ..., "arguments": {...}}</tool_call>` 형식입니다.
|
| 20 |
+
- 일반 대화·상식 응답은 `reply(text=...)`, 처리 불가 요청은 `escalate(query=원문)` 툴로 표현합니다.
|
| 21 |
+
- 인자는 사용자 문장의 표현을 원문 그대로 추출하도록 학습됐습니다 (한국어 인자의 영어 번역·요약·지어냄 억제).
|
| 22 |
+
- 처음 보는 툴 스키마(zero-shot toolset)에서도 동작하도록 학습됐습니다.
|
| 23 |
|
| 24 |
+
## 최신 버전 — 2026-09 (한국어 강화)
|
| 25 |
|
| 26 |
+
한국어 실사용 문체(구어체·간접 요청·긴 문맥·복합 고유명사) 6,000문장 직접 작성 데이터로 강화한 버전입니다.
|
| 27 |
|
| 28 |
+
| 평가 | 수치 |
|
| 29 |
+
|---|---|
|
| 30 |
+
| 한국어 평가셋 396 (decision / tool / args) | 96.7 / 95.5 / 82.8 |
|
| 31 |
+
| held-out 1,100 (decision / tool / args) | 99.4 / 99.2 / 97.5 |
|
| 32 |
+
| BFCL v3 single-turn (simple / multiple / irrelevance / overall) | 84.5 / 86.5 / 78.8 / **83.3** |
|
| 33 |
|
| 34 |
+
## 사용법
|
| 35 |
|
| 36 |
+
```python
|
| 37 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 38 |
+
from peft import PeftModel
|
| 39 |
|
| 40 |
+
base = "meta-llama/Llama-3.2-1B-Instruct"
|
| 41 |
+
model = AutoModelForCausalLM.from_pretrained(base, device_map="auto")
|
| 42 |
+
model = PeftModel.from_pretrained(model, "kimjg/toolRouter")
|
| 43 |
+
tokenizer = AutoTokenizer.from_pretrained("kimjg/toolRouter")
|
| 44 |
+
```
|
| 45 |
|
| 46 |
+
시스템 프롬프트에 툴 스키마 목록(JSON)과 `reply`/`escalate`를 포함해 주세요. 채팅 템플릿은 저장소의 `chat_template.jinja`에 포함돼 있습니다. greedy 디코딩을 권장하며, 프로덕션에서는 xgrammar 등 JSON 스키마 문법 강제(constrained decoding)를 함께 쓰면 파싱·스키마 통과율 100%를 보장할 수 있습니다.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
|
| 48 |
+
## 제한
|
| 49 |
|
| 50 |
+
- 단일 턴 라우팅 전용입니다 (멀티턴 문맥 참조는 미지원).
|
| 51 |
+
- 세계지식 추론이 필요한 인자 보정(예: 도시명→통화코드), 상대 날짜 해석은 다운스트림에서 처리하세요. 상대 날짜는 시스템 프롬프트에 현재 날짜를 제공하면 개선됩니다.
|
| 52 |
+
- base 모델의 Llama 3.2 Community License를 따릅니다.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|