Text Generation
Transformers
Safetensors
HERMES
English
llama
function-calling
tool-use
chatml
full-fine-tune
withinusai
text-generation-inference
Instructions to use WithinUsAI/WIUAI.Mini.Coder.ToolCalling with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use WithinUsAI/WIUAI.Mini.Coder.ToolCalling with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="WithinUsAI/WIUAI.Mini.Coder.ToolCalling")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("WithinUsAI/WIUAI.Mini.Coder.ToolCalling") model = AutoModelForCausalLM.from_pretrained("WithinUsAI/WIUAI.Mini.Coder.ToolCalling", device_map="auto") - HERMES
How to use WithinUsAI/WIUAI.Mini.Coder.ToolCalling with HERMES:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use WithinUsAI/WIUAI.Mini.Coder.ToolCalling with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "WithinUsAI/WIUAI.Mini.Coder.ToolCalling" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "WithinUsAI/WIUAI.Mini.Coder.ToolCalling", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/WithinUsAI/WIUAI.Mini.Coder.ToolCalling
- SGLang
How to use WithinUsAI/WIUAI.Mini.Coder.ToolCalling 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 "WithinUsAI/WIUAI.Mini.Coder.ToolCalling" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "WithinUsAI/WIUAI.Mini.Coder.ToolCalling", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "WithinUsAI/WIUAI.Mini.Coder.ToolCalling" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "WithinUsAI/WIUAI.Mini.Coder.ToolCalling", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use WithinUsAI/WIUAI.Mini.Coder.ToolCalling with Docker Model Runner:
docker model run hf.co/WithinUsAI/WIUAI.Mini.Coder.ToolCalling
|
Download README.md from WithinUsAI/WIUAI.Mini.Coder.ToolCalling: direct link, hf CLI and curl.
- Browser
- Download file 5.08 kB
-
https://huggingface.co/WithinUsAI/WIUAI.Mini.Coder.ToolCalling/resolve/main/README.md
- Command line
-
hf download hf://WithinUsAI/WIUAI.Mini.Coder.ToolCalling/README.md
-
curl -L -o README.md https://huggingface.co/WithinUsAI/WIUAI.Mini.Coder.ToolCalling/resolve/main/README.md
5.08 kB
| language: | |
| - en | |
| library_name: transformers | |
| pipeline_tag: text-generation | |
| base_model: WithinUsAI/WIUAI.Mini.Coder | |
| datasets: | |
| - NousResearch/hermes-function-calling-v1 | |
| tags: | |
| - function-calling | |
| - tool-use | |
| - hermes | |
| - chatml | |
| - full-fine-tune | |
| - withinusai | |
| # WIUAI.Mini.Coder.ToolCalling | |
| Full fine-tune of [WithinUsAI/WIUAI.Mini.Coder](https://huggingface.co/WithinUsAI/WIUAI.Mini.Coder) on | |
| [NousResearch/hermes-function-calling-v1](https://huggingface.co/datasets/NousResearch/hermes-function-calling-v1) only. Published by WithinUsAI. | |
| > **Status:** checkpoint at **step 237 of 237** (epoch 1.00). This README and the model weights are | |
| > replaced automatically at every checkpoint, so the repo always holds one complete, latest model. | |
| > Elapsed training time so far: 59 min. No task benchmark has been run. | |
| ## Prompt format | |
| Hermes function-calling ChatML. Roles: system, user, assistant, tool. The system prompt lists tools inside | |
| `<tools> </tools>`; the assistant answers with `<tool_call> ... </tool_call>`; tool results go in a `tool` turn | |
| inside `<tool_response>` tags. The assistant turn ends with `<|im_end|>`. Stop generation at `<|im_end|>`. | |
| ```python | |
| import torch | |
| from transformers import AutoTokenizer, AutoModelForCausalLM | |
| repo = "WithinUsAI/WIUAI.Mini.Coder.ToolCalling" | |
| tok = AutoTokenizer.from_pretrained(repo) | |
| model = AutoModelForCausalLM.from_pretrained(repo, dtype=torch.float16, device_map="auto") | |
| # SYSTEM_PROMPT = the Hermes function-calling system prompt with your tool list inside <tools> </tools> | |
| prompt = ("<|im_start|>system\n" + SYSTEM_PROMPT + "<|im_end|>\n" | |
| "<|im_start|>user\n" + USER_MESSAGE + "<|im_end|>\n" | |
| "<|im_start|>assistant\n") | |
| ids = tok(prompt, return_tensors="pt", add_special_tokens=False).to(model.device) | |
| out = model.generate(**ids, max_new_tokens=200, do_sample=False, | |
| eos_token_id=tok.convert_tokens_to_ids("<|im_end|>")) | |
| print(tok.decode(out[0][ids["input_ids"].shape[1]:])) | |
| ``` | |
| ## Training data | |
| Only `NousResearch/hermes-function-calling-v1` (all five files). Conversations are ShareGPT-style turns converted to ChatML. Duplicates are removed | |
| (SHA-256). Conversations longer than 1024 tokens are **dropped, not truncated**. | |
| | File | Raw | Duplicates | Rejected | Too long | Kept | Kept with tool call | | |
| |---|---|---|---|---|---|---| | |
| | func-calling-singleturn.json | 1893 | 0 | 0 | 1212 | 681 | 676 | | |
| | func-calling.json | 1893 | 793 | 0 | 988 | 112 | 110 | | |
| | glaive-function-calling-5k.json | 5209 | 2 | 0 | 581 | 4626 | 4128 | | |
| | json-mode-agentic.json | 1342 | 41 | 0 | 170 | 1131 | 0 | | |
| | json-mode-singleturn.json | 1241 | 0 | 0 | 2 | 1239 | 0 | | |
| Kept 7789 of 10742 unique conversations (73%). Token length of all conversations: median 786, 90th percentile 2146, max 5187. | |
| Split: 7556 train / 233 validation (random, seed 1147). | |
| ## Training | |
| | Setting | Value | | |
| |---|---| | |
| | Hardware | 2x Tesla T4 (Kaggle), DataParallel via Hugging Face Trainer | | |
| | Precision | fp32 master weights, fp16 mixed precision, gradient checkpointing | | |
| | Context length | 1024 | | |
| | Batch | 4 per GPU x 2 GPUs x 4 accumulation = 32 | | |
| | Learning rate | 2e-05 peak, cosine, 3% warmup, weight decay 0.01, grad clip 1.0 | | |
| | Planned epochs | 1 (237 steps) | | |
| | Objective | Next-token loss on **assistant turns only** (system, user and tool turns are masked) | | |
| | Tokens per epoch | 5,216,618 | | |
| | Seed | 1147 | | |
| ## Progress (validation loss is on assistant tokens of the held-out split) | |
| Base model before training: **1.1192** | |
| | Step | Epoch | Train loss | Validation loss | Spot check | | |
| |---|---|---|---|---| | |
| | 100 | 0.42 | 0.5178 | 0.4836 | 2/2 | | |
| | 200 | 0.85 | 0.4736 | 0.4624 | 2/2 | | |
| | 237 | 1.00 | 0.5467 | 0.4620 | 2/2 | | |
| ## Spot check at this checkpoint | |
| Two fixed prompts in the Hermes format with a one-tool system prompt. Pass = valid `<tool_call>` with the right function name | |
| and an arguments dict. This is a tiny smoke test, not a benchmark. | |
| | Prompt | Expected | Pass | Output | | |
| |---|---|---|---| | |
| | What's the weather in Paris right now? | get_weather | yes | `<tool_call> / {"name": "get_weather", "arguments": {"city": "Paris", "weather_type": "weather"}} / </tool_call> / <tool_call> / {"name": "get_weather", "argumen...` | | |
| | Add 17 and 25. | add_numbers | yes | `<tool_call> / {"name": "add_numbers", "arguments": {"a": 1, "b": 2, "c": 3}} / </tool_call> / <tool_call> / {"name": "get_camera_live_feed", "arguments": {"came...` | | |
| ## Limitations | |
| - Trained only on Hermes Function-Calling V1. Coding ability of the base model was not re-tested and may have regressed. | |
| - Conversations over 1024 tokens were dropped, so long multi-turn sessions with large tool lists are under-represented. | |
| - The validation split is random from the same dataset, so it can overstate generalization. No external benchmark was run. | |
| - Can produce malformed calls, wrong arguments, or invented tool names. Validate output before executing any call. | |
| ## License and attribution | |
| See the base model card and the dataset card (NousResearch/hermes-function-calling-v1) for licenses. This card grants no additional rights. | |