Instructions to use shreyasmeher/Qwen-GLOCON-Reasoning with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use shreyasmeher/Qwen-GLOCON-Reasoning with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="shreyasmeher/Qwen-GLOCON-Reasoning") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("shreyasmeher/Qwen-GLOCON-Reasoning", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use shreyasmeher/Qwen-GLOCON-Reasoning 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 shreyasmeher/Qwen-GLOCON-Reasoning:Q8_0 # Run inference directly in the terminal: llama cli -hf shreyasmeher/Qwen-GLOCON-Reasoning:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf shreyasmeher/Qwen-GLOCON-Reasoning:Q8_0 # Run inference directly in the terminal: llama cli -hf shreyasmeher/Qwen-GLOCON-Reasoning:Q8_0
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 shreyasmeher/Qwen-GLOCON-Reasoning:Q8_0 # Run inference directly in the terminal: ./llama-cli -hf shreyasmeher/Qwen-GLOCON-Reasoning:Q8_0
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 shreyasmeher/Qwen-GLOCON-Reasoning:Q8_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf shreyasmeher/Qwen-GLOCON-Reasoning:Q8_0
Use Docker
docker model run hf.co/shreyasmeher/Qwen-GLOCON-Reasoning:Q8_0
- LM Studio
- Jan
- Ollama
How to use shreyasmeher/Qwen-GLOCON-Reasoning with Ollama:
ollama run hf.co/shreyasmeher/Qwen-GLOCON-Reasoning:Q8_0
- Unsloth Studio
How to use shreyasmeher/Qwen-GLOCON-Reasoning 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 shreyasmeher/Qwen-GLOCON-Reasoning 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 shreyasmeher/Qwen-GLOCON-Reasoning to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for shreyasmeher/Qwen-GLOCON-Reasoning to start chatting
- Pi
How to use shreyasmeher/Qwen-GLOCON-Reasoning with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf shreyasmeher/Qwen-GLOCON-Reasoning:Q8_0
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": "shreyasmeher/Qwen-GLOCON-Reasoning:Q8_0" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use shreyasmeher/Qwen-GLOCON-Reasoning with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf shreyasmeher/Qwen-GLOCON-Reasoning:Q8_0
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 shreyasmeher/Qwen-GLOCON-Reasoning:Q8_0
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use shreyasmeher/Qwen-GLOCON-Reasoning with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf shreyasmeher/Qwen-GLOCON-Reasoning:Q8_0
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 "shreyasmeher/Qwen-GLOCON-Reasoning:Q8_0" \ --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"
- Docker Model Runner
How to use shreyasmeher/Qwen-GLOCON-Reasoning with Docker Model Runner:
docker model run hf.co/shreyasmeher/Qwen-GLOCON-Reasoning:Q8_0
- Lemonade
How to use shreyasmeher/Qwen-GLOCON-Reasoning with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull shreyasmeher/Qwen-GLOCON-Reasoning:Q8_0
Run and chat with the model
lemonade run user.Qwen-GLOCON-Reasoning-Q8_0
List all available models
lemonade list
GLOCON-Reasoning: Qwen2.5-3B with GRPO Reinforcement Learning
Important Usage Note
Essential: When using this model, you must set the prompt as described below to ensure the model follows the required structured reasoning format. Without explicitly setting the prompt, the model's outputs may not adhere to the expected XML structure and reasoning guidelines.
For instance, include the following prompt in your inference code:
prompt = """
You are identifying conflict events and assigning them to one of five predefined categories. Think carefully and reason deeply, but when giving the final answer, provide only minimal, fixed-format outputs without any extra words.
Format your response:
<reasoning>
- Carefully analyze the text and explain:
1. What action(s) triggered the event.
2. Who are the participants or organizers.
3. Where the event happened (city and country).
4. Whether the event was violent or non-violent.
5. Which of the five event categories fits best, and why.
</reasoning>
<answer>
1. Trigger: <exact phrase>
2. Participants: <actor1, actor2,...>
3. Location: <city, country>
4. Violence: <Violent / Non-violent>
5. Category: <one of: Demonstration / Armed Militancy / Group Clash / Industrial Action / Other>
</answer>
"""
Reinforcement Learning Highlights
Unlike traditional supervised fine-tuning (used in ConflLlama), this model uses GRPO to:
- Optimize multiple reward signals simultaneously
- Enforce structured reasoning format through reinforcement signals
- Improve output consistency with formatted XML responses
- Self-improve through reinforcement rather than direct imitation
Training Data
- Dataset: GLOCON event classification dataset
- Time Period: Contemporary civil conflict events
- Format: News articles with associated event categories
- Labels: Five main event categories:
- Demonstration
- Armed Militancy
- Group Clash
- Industrial Action
- Other
Data Processing
- Train/Test Split:
- 80% training, 20% testing
- Consistent random seed (42) for reproducibility
- Format Standardization:
- System prompt with structured reasoning requirements
- Consistent XML output format
- Answer Extraction:
- Specialized extraction from structured responses
- Validation against known categories
Training Format
- Input: News article describing potential conflict event
- Output: Structured XML with reasoning and final category
Key Mathematical Concepts
Policy Gradient with Multiple Rewards
The GRPO approach optimizes policy parameters using:
Reward Functions
Our implementation uses five specialized reward functions:
- Correctness Reward: 2.0 points for accurate classification
- Category Format Reward: 0.5 points for valid category selection
- Format Rewards: Combined 1.0 points for proper XML structure
- XML Microrewards: Small incentives for tag placement and structure
Training Details
- Framework: Unsloth GRPO
- Hardware: Single NVIDIA GPU with vLLM acceleration
- Training Configuration:
- Batch Size: 1 per device
- Gradient Accumulation Steps: 4
- Learning Rate: 5e-6
- Max Steps: 1,000
- Save Steps: 500
- Logging Steps: 1
- Samples per prompt: 6
- Memory utilization: 60%
LoRA Configuration
- Rank: 64 (significantly larger than ConflLlama's rank 8)
- Target Modules: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
- Alpha Scaling: 64
- Quantization: 4-bit training
- Gradient Checkpointing: Enabled ("unsloth" mode)
Generation Parameters
- Temperature: 0.8
- Top-p: 0.95
- Max tokens: 256
- Max prompt length: 512
Model Architecture
The training architecture combines reinforcement learning with efficient LLM fine-tuning.
Reinforcement Learning Benefits
This model demonstrates key advantages over supervised fine-tuning:
Structured Output Enforcement
- Consistent XML formatting:
<reasoning> 1. Triggers detected: [...] 2. Participants and organizers: [...] 3. Location details: [...] 4. Violence assessment: [...] 5. Event category determination: [...] </reasoning> <answer> [Final category] </answer>Improved Reasoning Capability
- Explicit step-by-step reasoning before final classification
- Consideration of multiple factors (violence, participants, location)
- Transparent justification process
Reward-Based Improvement
- Self-correcting behavior through multiple reward signals
- Balance between format adherence and classification accuracy
- Incentivizes proper structure without sacrificing correctness
Implementation Details
The reward functions are implemented with efficient vectorized operations:
def correctness_reward_func(prompts, completions, answer, **kwargs) -> list[float]:
responses = [completion[0]['content'] for completion in completions]
extracted_responses = [extract_xml_answer(r) for r in responses]
return [2.0 if r.strip() == a.strip() else 0.0
for r, a in zip(extracted_responses, answer)]
Memory Optimizations
- Used 4-bit quantization
- Gradient accumulation steps: 4
- Memory-efficient gradient checkpointing
- Reduced maximum sequence length to 1024
- GPU memory utilization capped at 60%
- Fast inference with vLLM
Intended Use
This model is designed for:
- Classification of civil conflict events with reasoning
- Academic research requiring transparent decision processes
- Event analysis with structured outputs
- Educational demonstration of RL-based classification
Limitations
- Fixed output structure may limit flexibility
- Performance dependent on quality of reward functions
- Maximum sequence length limited to 1024 tokens
- Reinforcement may overoptimize for reward signals rather than true understanding
- Limited to five predefined event categories
- May not generalize well to conflict events outside training distribution
Ethical Considerations
- Model trained on conflict event data
- Should be used responsibly for research purposes only
- Not intended for operational security decisions
- Results should be interpreted with appropriate context
- May contain biases present in training data
Citation
@misc{glocon-reasoning,
author = {Meher, Shreyas},
title = {GLOCON-Reasoning: Qwen2.5-3B with GRPO Reinforcement Learning},
year = {2024},
publisher = {HuggingFace},
note = {Based on Qwen2.5-3B-Instruct and GRPO framework}
}
Acknowledgments
- Unsloth for GRPO implementation and optimization framework
- Qwen team for the base model
- Hugging Face for transformers infrastructure
- vLLM team for fast inference capabilities
- This research was supported by NSF award 2311142

- Downloads last month
- 19
8-bit