Text Generation
Transformers
Safetensors
GGUF
English
llama
terminal
bash
zsh
fish
cli
autocomplete
tiny-lm
text-generation-inference
Instructions to use BelugaDataSetCoder/ClangCoder-0.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BelugaDataSetCoder/ClangCoder-0.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="BelugaDataSetCoder/ClangCoder-0.1")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("BelugaDataSetCoder/ClangCoder-0.1") model = AutoModelForCausalLM.from_pretrained("BelugaDataSetCoder/ClangCoder-0.1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use BelugaDataSetCoder/ClangCoder-0.1 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 BelugaDataSetCoder/ClangCoder-0.1 # Run inference directly in the terminal: llama cli -hf BelugaDataSetCoder/ClangCoder-0.1
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf BelugaDataSetCoder/ClangCoder-0.1 # Run inference directly in the terminal: llama cli -hf BelugaDataSetCoder/ClangCoder-0.1
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 BelugaDataSetCoder/ClangCoder-0.1 # Run inference directly in the terminal: ./build/bin/llama cli -hf BelugaDataSetCoder/ClangCoder-0.1
Use Docker
docker model run hf.co/BelugaDataSetCoder/ClangCoder-0.1
- Llama new
- LM Studio
- Jan
- vLLM
How to use BelugaDataSetCoder/ClangCoder-0.1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "BelugaDataSetCoder/ClangCoder-0.1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BelugaDataSetCoder/ClangCoder-0.1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/BelugaDataSetCoder/ClangCoder-0.1
- SGLang
How to use BelugaDataSetCoder/ClangCoder-0.1 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 "BelugaDataSetCoder/ClangCoder-0.1" \ --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": "BelugaDataSetCoder/ClangCoder-0.1", "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 "BelugaDataSetCoder/ClangCoder-0.1" \ --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": "BelugaDataSetCoder/ClangCoder-0.1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use BelugaDataSetCoder/ClangCoder-0.1 with Ollama:
ollama run hf.co/BelugaDataSetCoder/ClangCoder-0.1
- Unsloth Desktop
- Docker Model Runner
How to use BelugaDataSetCoder/ClangCoder-0.1 with Docker Model Runner:
docker model run hf.co/BelugaDataSetCoder/ClangCoder-0.1
- Lemonade
How to use BelugaDataSetCoder/ClangCoder-0.1 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull BelugaDataSetCoder/ClangCoder-0.1
Run and chat with the model
lemonade run user.ClangCoder-0.1-{{QUANT_TAG}}List all available models
lemonade list
- Atomic Chat
Release ClangCoder-0.1 (2.05M parameters)
Browse files- .gitattributes +1 -0
- ClangCoder-0.1.gguf +3 -0
- Modelfile +11 -0
- README.md +53 -0
- config.json +32 -0
- generation_config.json +10 -0
- model.safetensors +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +9 -0
- training_args.bin +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
ClangCoder-0.1.gguf filter=lfs diff=lfs merge=lfs -text
|
ClangCoder-0.1.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:38647027abd9a012e17958e054ef4946d2d4690005c2701886dec095e58f89c9
|
| 3 |
+
size 2994912
|
Modelfile
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM ./ClangCoder-0.1.gguf
|
| 2 |
+
|
| 3 |
+
TEMPLATE """<|user|>
|
| 4 |
+
{{ .Prompt }}
|
| 5 |
+
<|assistant|>
|
| 6 |
+
"""
|
| 7 |
+
|
| 8 |
+
PARAMETER stop "<|end|>"
|
| 9 |
+
PARAMETER stop "<|user|>"
|
| 10 |
+
PARAMETER temperature 0.2
|
| 11 |
+
PARAMETER num_ctx 256
|
README.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
library_name: transformers
|
| 6 |
+
tags:
|
| 7 |
+
- llama
|
| 8 |
+
- terminal
|
| 9 |
+
- bash
|
| 10 |
+
- zsh
|
| 11 |
+
- fish
|
| 12 |
+
- cli
|
| 13 |
+
- autocomplete
|
| 14 |
+
- gguf
|
| 15 |
+
- tiny-lm
|
| 16 |
+
datasets:
|
| 17 |
+
- BelugaDataSetCoder/ClangCodeDataset
|
| 18 |
+
pipeline_tag: text-generation
|
| 19 |
+
---
|
| 20 |
+
|
| 21 |
+
# ClangCoder-0.1 (2.05M Ultra-Compact Terminal & CLI Model)
|
| 22 |
+
|
| 23 |
+
**ClangCoder-0.1** is a 2.05M-parameter causal language model based on the Llama architecture, trained from scratch for ultra-fast terminal command autocompletion (`bash`, `zsh`, `fish`) and CLI command generation.
|
| 24 |
+
|
| 25 |
+
## Model Details
|
| 26 |
+
- **Architecture:** LlamaForCausalLM (`hidden_size=160`, `layers=4`, `heads=4`, `kv_heads=2`, `context=256`)
|
| 27 |
+
- **Parameters:** ~2.05M
|
| 28 |
+
- **Tokenizer:** Custom 2,048-token BPE vocabulary trained specifically on Linux/Unix shell syntax
|
| 29 |
+
- **Training Data:** `BelugaDataSetCoder/ClangCodeDataset`
|
| 30 |
+
- **Formats Included:** SafeTensors (PyTorch / Hugging Face) and `ClangCoder-0.1.gguf` (FP16 for `llama.cpp` / Ollama)
|
| 31 |
+
|
| 32 |
+
## Prompt Format
|
| 33 |
+
|
| 34 |
+
The model uses ChatML-style special tokens with a shell tag (`[bash]`, `[zsh]`, or `[fish]`):
|
| 35 |
+
|
| 36 |
+
```text
|
| 37 |
+
<|user|>
|
| 38 |
+
[bash] git status --short
|
| 39 |
+
<|assistant|>
|
| 40 |
+
--branch<|end|>
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
## Quick Start with Ollama
|
| 44 |
+
|
| 45 |
+
1. Download `ClangCoder-0.1.gguf` and `Modelfile` from this repository.
|
| 46 |
+
2. Create the model in Ollama:
|
| 47 |
+
```bash
|
| 48 |
+
ollama create clangcoder-0.1 -f Modelfile
|
| 49 |
+
```
|
| 50 |
+
3. Run a completion:
|
| 51 |
+
```bash
|
| 52 |
+
ollama run clangcoder-0.1 "[fish] How do I set a global exported environment variable in Fish?"
|
| 53 |
+
```
|
config.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"LlamaForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"bos_token_id": 1,
|
| 8 |
+
"dtype": "float32",
|
| 9 |
+
"eos_token_id": 2,
|
| 10 |
+
"head_dim": 40,
|
| 11 |
+
"hidden_act": "silu",
|
| 12 |
+
"hidden_size": 160,
|
| 13 |
+
"initializer_range": 0.02,
|
| 14 |
+
"intermediate_size": 432,
|
| 15 |
+
"max_position_embeddings": 256,
|
| 16 |
+
"mlp_bias": false,
|
| 17 |
+
"model_type": "llama",
|
| 18 |
+
"num_attention_heads": 4,
|
| 19 |
+
"num_hidden_layers": 4,
|
| 20 |
+
"num_key_value_heads": 2,
|
| 21 |
+
"pad_token_id": 0,
|
| 22 |
+
"pretraining_tp": 1,
|
| 23 |
+
"rms_norm_eps": 1e-06,
|
| 24 |
+
"rope_parameters": {
|
| 25 |
+
"rope_theta": 10000.0,
|
| 26 |
+
"rope_type": "default"
|
| 27 |
+
},
|
| 28 |
+
"tie_word_embeddings": true,
|
| 29 |
+
"transformers_version": "5.24.1",
|
| 30 |
+
"use_cache": false,
|
| 31 |
+
"vocab_size": 2048
|
| 32 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 1,
|
| 4 |
+
"eos_token_id": 2,
|
| 5 |
+
"output_attentions": false,
|
| 6 |
+
"output_hidden_states": false,
|
| 7 |
+
"pad_token_id": 0,
|
| 8 |
+
"transformers_version": "5.24.1",
|
| 9 |
+
"use_cache": true
|
| 10 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9185d3fa2e4cf0242b0a1a56525bfe9ca8306bcb96648ac61b3cd37386420ec4
|
| 3 |
+
size 5867088
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"bos_token": "<|begin|>",
|
| 4 |
+
"eos_token": "<|end|>",
|
| 5 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 6 |
+
"pad_token": "<|pad|>",
|
| 7 |
+
"tokenizer_class": "TokenizersBackend",
|
| 8 |
+
"unk_token": "<|unk|>"
|
| 9 |
+
}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f306175637ad169261ea2263cd85b15cd57a83df8bab6b64fbd88fb5772bd3a3
|
| 3 |
+
size 5265
|