Instructions to use FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview", filename="GGUF/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview.BF16.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview 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 FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview:Q4_K_M # Run inference directly in the terminal: llama cli -hf FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview:Q4_K_M # Run inference directly in the terminal: llama cli -hf FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview: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 FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview: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 FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview:Q4_K_M
Use Docker
docker model run hf.co/FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview with Ollama:
ollama run hf.co/FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview:Q4_K_M
- Unsloth Studio
How to use FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview to start chatting
- Pi
How to use FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview: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 FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview:Q4_K_M
Run Hermes
hermes
- Atomic Chat new
- Docker Model Runner
How to use FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview with Docker Model Runner:
docker model run hf.co/FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview:Q4_K_M
- Lemonade
How to use FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview:Q4_K_M
Run and chat with the model
lemonade run user.typhoon-s-4b-nitibench-ccl-legal-agent-research-preview-Q4_K_M
List all available models
lemonade list
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex
# Run unsloth studio
unsloth studio -H 0.0.0.0 -p 8888
# Then open http://localhost:8888 in your browser
# Search for FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview to start chattingUsing HuggingFace Spaces for Unsloth
# No setup required# Open https://huggingface.co/spaces/unsloth/studio in your browser
# Search for FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview to start chattingTyphoon-S-4B NitiBench-CCL Legal Agent (Research Preview)
Typhoon-S-4B NitiBench-CCL Legal Agent is a "Sovereign," domain-specific research artifact designed to demonstrate that domain-specific sovereignty—through InK-GRPO–based agentic RFT— can outperform brute-force scale through a carefully designed post-training strategy.
For more information, please read the full technical report on arXiv.
This checkpoint is not a general-purpose instruction model and not intended for production or real-world legal use.
- Not a product model
- Not a general Thai legal assistant
- Not safe or reliable for legal advice
- Not expected to be useful outside the intended evaluation setup If you are looking for a generally capable assistant or a model for real-world legal workflows, do not use this.
Training Overview
Typhoon-S-4B NitiBench-CCL Legal Agent is post-trained using GRPO-based RFT with two key extensions.
Agentic RFT
- The model is trained as a multi-step agent operating in a controlled RAG environment.
- Available tools:
search: semantic retrieval over a Thai legal corpusread: document-level content access
- GRPO is applied over entire interaction trajectories, not single turns.
- Rewards focus on final-answer correctness.
InK-GRPO (Injected Knowledge GRPO)
GRPO is augmented with a stochastic auxiliary next-token prediction objective on in-domain Thai legal text:
This allows domain knowledge injection during reinforcement fine-tuning without collapsing into pure supervised learning.
Training Data (High-Level)
Training is centered on NitiBench (CCL) and aligned Thai legal corpora:
- RFT (GRPO):
- Question–answer tasks derived from
airesearch/WangchanX-Legal-ThaiCCL-RAG(CCL split) - Rewarded based on correctness against reference answers (LLM-as-a-judge in the paper setup)
- Question–answer tasks derived from
- CE data (InK-GRPO):
- In-domain Thai legal text for auxiliary next-token prediction
Exact datasets, filtering, and preprocessing are described in the Typhoon-S technical report and NitiBench documentation.
Evaluation
Agent-Based Evaluation Required
This model is only meaningful when evaluated using the official agentic setup:
https://github.com/scb-10x/typhoon-s/tree/master/evaluation
Evaluating this checkpoint outside the specified agent + RAG environment will produce non-comparable and misleading results.
NitiBench (Thai Legal Reasoning, Agentic)
| Model | NitiBench Accuracy |
|---|---|
| Qwen3-4B-Instruct-2507 + Agent | 46.11% |
| GPT-5 + Built-in Search | 38.07% |
| GPT-5 + Agent | 75.34% |
| GRPO + Agent | 73.73% |
| Typhoon-S-4B NitiBench-CCL InK-GRPO + Agent | 78.02% |
Results are benchmark- and environment-specific and should not be interpreted as general legal competence.
How to Use (Research Only)
This checkpoint is intended only for:
- Studying Agentic RFT and InK-GRPO behavior
Recommended Usage
Run the official agentic evaluation pipeline:
https://github.com/scb-10x/typhoon-s/tree/master/evaluation
Expected conditions:
- Agent-style prompting
search/readtools enabled- Thai legal corpus aligned with NitiBench
- Evaluation protocol unchanged
Intended Uses & Limitations
Intended Use
- Research-only experimentation
- Benchmark comparison under NitiBench agentic evaluation
Limitations & Risks
- Not a deployable model
- Not legal advice
- Benchmark-specific optimization
- Environment-dependent performance
- No safety, bias, or robustness guarantees
- May hallucinate statutes, cases, or interpretations
Citation
If you use this model or its methods, please cite the Typhoon-S technical report.
If you use the dataset, please cite NitiBench directly.
@misc{pipatanakul2026typhoonsminimalopenposttraining,
title={Typhoon-S: Minimal Open Post-Training for Sovereign Large Language Models},
author={Kunat Pipatanakul and Pittawat Taveekitworachai},
year={2026},
eprint={2601.18129},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2601.18129},
}
- Downloads last month
- 70
Model tree for FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview
Base model
Qwen/Qwen3-4B-Instruct-2507
Install Unsloth Studio (macOS, Linux, WSL)
# Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for FILM6912/typhoon-s-4b-nitibench-ccl-legal-agent-research-preview to start chatting