Text Generation
GGUF
English
latex
voice
accessibility
math
transcription
fine-tuned
quantized
conversational
Instructions to use kennethge123/latex-voice-qwen3.5-2b-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use kennethge123/latex-voice-qwen3.5-2b-4bit 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 kennethge123/latex-voice-qwen3.5-2b-4bit:Q4_K_M # Run inference directly in the terminal: llama cli -hf kennethge123/latex-voice-qwen3.5-2b-4bit:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf kennethge123/latex-voice-qwen3.5-2b-4bit:Q4_K_M # Run inference directly in the terminal: llama cli -hf kennethge123/latex-voice-qwen3.5-2b-4bit: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 kennethge123/latex-voice-qwen3.5-2b-4bit:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf kennethge123/latex-voice-qwen3.5-2b-4bit: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 kennethge123/latex-voice-qwen3.5-2b-4bit:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf kennethge123/latex-voice-qwen3.5-2b-4bit:Q4_K_M
Use Docker
docker model run hf.co/kennethge123/latex-voice-qwen3.5-2b-4bit:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use kennethge123/latex-voice-qwen3.5-2b-4bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kennethge123/latex-voice-qwen3.5-2b-4bit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kennethge123/latex-voice-qwen3.5-2b-4bit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/kennethge123/latex-voice-qwen3.5-2b-4bit:Q4_K_M
- Ollama
How to use kennethge123/latex-voice-qwen3.5-2b-4bit with Ollama:
ollama run hf.co/kennethge123/latex-voice-qwen3.5-2b-4bit:Q4_K_M
- Unsloth Desktop
- Pi
How to use kennethge123/latex-voice-qwen3.5-2b-4bit with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf kennethge123/latex-voice-qwen3.5-2b-4bit: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": "kennethge123/latex-voice-qwen3.5-2b-4bit:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use kennethge123/latex-voice-qwen3.5-2b-4bit with Docker Model Runner:
docker model run hf.co/kennethge123/latex-voice-qwen3.5-2b-4bit:Q4_K_M
- Lemonade
How to use kennethge123/latex-voice-qwen3.5-2b-4bit with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull kennethge123/latex-voice-qwen3.5-2b-4bit:Q4_K_M
Run and chat with the model
lemonade run user.latex-voice-qwen3.5-2b-4bit-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use kennethge123/latex-voice-qwen3.5-2b-4bit with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf kennethge123/latex-voice-qwen3.5-2b-4bit: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 kennethge123/latex-voice-qwen3.5-2b-4bit:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use kennethge123/latex-voice-qwen3.5-2b-4bit with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf kennethge123/latex-voice-qwen3.5-2b-4bit: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 "kennethge123/latex-voice-qwen3.5-2b-4bit: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"
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
base_model: Qwen/Qwen3.5-2B
|
| 6 |
+
tags:
|
| 7 |
+
- latex
|
| 8 |
+
- voice
|
| 9 |
+
- accessibility
|
| 10 |
+
- math
|
| 11 |
+
- transcription
|
| 12 |
+
- fine-tuned
|
| 13 |
+
- gguf
|
| 14 |
+
- quantized
|
| 15 |
+
datasets:
|
| 16 |
+
- kennethge123/latex-voice-dataset
|
| 17 |
+
pipeline_tag: text-generation
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
# LaTeX Voice qwen3.5-2b (Q4_K_M GGUF)
|
| 21 |
+
|
| 22 |
+
Fine-tuned **Qwen/Qwen3.5-2B** for voice-driven LaTeX transcription and editing, designed to help people with disabilities (fine motor disabilities, blindness, low vision) participate in STEM.
|
| 23 |
+
|
| 24 |
+
This model converts natural language voice transcriptions into LaTeX notation, and can also edit existing LaTeX expressions based on voice commands. It handles messy speech-to-text output including homophones, filler words, truncations, and other real-world STT artifacts.
|
| 25 |
+
|
| 26 |
+
Based on the [Phoenix](https://arxiv.org/abs/2508.07576) and [StereoMath](https://arxiv.org/abs/2501.01404) research papers.
|
| 27 |
+
|
| 28 |
+
## Usage (llama.cpp)
|
| 29 |
+
|
| 30 |
+
This repo contains a **Q4_K_M GGUF** file for use with [llama.cpp](https://github.com/ggerganov/llama.cpp). This is the recommended format for edge/laptop deployment with Vulkan or Metal acceleration.
|
| 31 |
+
|
| 32 |
+
```bash
|
| 33 |
+
# Download the GGUF file
|
| 34 |
+
huggingface-cli download kennethge123/latex-voice-qwen3.5-2b-4bit qwen3.5-2b-Q4_K_M.gguf --local-dir .
|
| 35 |
+
|
| 36 |
+
# Run with llama.cpp server
|
| 37 |
+
./llama-server -m qwen3.5-2b-Q4_K_M.gguf -c 2048 -ngl 99
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
#### Example API call (with llama-server running)
|
| 41 |
+
|
| 42 |
+
```bash
|
| 43 |
+
curl http://localhost:8080/v1/chat/completions -H "Content-Type: application/json" -d '{
|
| 44 |
+
"messages": [
|
| 45 |
+
{"role": "system", "content": "Your goal is to transcribe what the user is saying into LaTeX. Output in <latex></latex> blocks."},
|
| 46 |
+
{"role": "user", "content": "User Instruction: the integral from zero to infinity of e to the negative x squared dx"}
|
| 47 |
+
],
|
| 48 |
+
"max_tokens": 256,
|
| 49 |
+
"temperature": 0
|
| 50 |
+
}'
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
For the full-precision transformers version, see [kennethge123/latex-voice-qwen3.5-2b](https://huggingface.co/kennethge123/latex-voice-qwen3.5-2b).
|
| 54 |
+
|
| 55 |
+
## Evaluation Results
|
| 56 |
+
|
| 57 |
+
| Configuration | Exact Match | First Match | N |
|
| 58 |
+
|---|---|---|---|
|
| 59 |
+
| Full precision (standard prompt) | 56.6% | 56.6% | 500 |
|
| 60 |
+
| Full precision (varied prompts) | 50.2% | 50.2% | 500 |
|
| 61 |
+
| 4-bit quantized (standard prompt) | 54.6% | 54.4% | 500 |
|
| 62 |
+
| 4-bit quantized (varied prompts) | 48.4% | 48.4% | 500 |
|
| 63 |
+
|
| 64 |
+
**Metrics:**
|
| 65 |
+
- **Exact Match**: Predicted LaTeX (after normalization) matches any expected output exactly
|
| 66 |
+
- **First Match**: First predicted output matches any expected output
|
| 67 |
+
- **Standard prompt**: Uses the same system prompt as training
|
| 68 |
+
- **Varied prompts**: Uses randomized system prompts to test generalization (more representative of real-world use)
|
| 69 |
+
|
| 70 |
+
## Training Details
|
| 71 |
+
|
| 72 |
+
- **Base model**: Qwen/Qwen3.5-2B
|
| 73 |
+
- **Method**: LoRA fine-tuning (r=64, alpha=128)
|
| 74 |
+
- **Dataset**: ~60K examples (30K transcription, 20K editing, 10K transforms)
|
| 75 |
+
- **Data mix**: 55% clean voice, 45% messy/realistic STT artifacts
|
| 76 |
+
- **Epochs**: 2-3
|
| 77 |
+
- **Optimizer**: AdamW with cosine schedule
|
| 78 |
+
- **Quantization**: Q4_K_M (GGUF) — converted from full-precision merged weights via llama.cpp
|
| 79 |
+
|
| 80 |
+
## Intended Use
|
| 81 |
+
|
| 82 |
+
This model is designed for:
|
| 83 |
+
- Voice-to-LaTeX transcription for accessibility tools
|
| 84 |
+
- Editing LaTeX expressions via natural language commands
|
| 85 |
+
- Mathematical transformations (simplify, factor, differentiate, etc.)
|
| 86 |
+
- Integration with voice-powered math workspaces like Phoenix
|
| 87 |
+
|
| 88 |
+
## Limitations
|
| 89 |
+
|
| 90 |
+
- Exact match is a strict metric; the model may produce mathematically equivalent but syntactically different LaTeX
|
| 91 |
+
- Performance on very advanced (PhD-level) notation may be lower
|
| 92 |
+
- The model works best with the context engine pattern from Phoenix
|
| 93 |
+
- Voice transcription artifacts not in the training distribution may cause issues
|
| 94 |
+
|
| 95 |
+
## Citation
|
| 96 |
+
|
| 97 |
+
```bibtex
|
| 98 |
+
@article{ge2025phoenix,
|
| 99 |
+
title={Phoenix: A Novel Context-Aware Voice-Powered Math Equation Workspace and Editor},
|
| 100 |
+
author={Ge, Kenneth and Paul, Ryan and Zhang, Priscilla and Seo, JooYoung},
|
| 101 |
+
journal={arXiv preprint arXiv:2508.07576},
|
| 102 |
+
year={2025}
|
| 103 |
+
}
|
| 104 |
+
```
|