GGUF
English
text-detoxification
text2text-generation
detoxification
content-moderation
toxicity-reduction
llama
minibase
Eval Results (legacy)
Instructions to use Minibase/Detoxify-Language-Small 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 Minibase/Detoxify-Language-Small 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 Minibase/Detoxify-Language-Small:Q8_0 # Run inference directly in the terminal: llama cli -hf Minibase/Detoxify-Language-Small:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Minibase/Detoxify-Language-Small:Q8_0 # Run inference directly in the terminal: llama cli -hf Minibase/Detoxify-Language-Small: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 Minibase/Detoxify-Language-Small:Q8_0 # Run inference directly in the terminal: ./llama-cli -hf Minibase/Detoxify-Language-Small: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 Minibase/Detoxify-Language-Small:Q8_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf Minibase/Detoxify-Language-Small:Q8_0
Use Docker
docker model run hf.co/Minibase/Detoxify-Language-Small:Q8_0
- LM Studio
- Jan
- Ollama
How to use Minibase/Detoxify-Language-Small with Ollama:
ollama run hf.co/Minibase/Detoxify-Language-Small:Q8_0
- Unsloth Studio
How to use Minibase/Detoxify-Language-Small 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 Minibase/Detoxify-Language-Small 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 Minibase/Detoxify-Language-Small to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Minibase/Detoxify-Language-Small to start chatting
- Docker Model Runner
How to use Minibase/Detoxify-Language-Small with Docker Model Runner:
docker model run hf.co/Minibase/Detoxify-Language-Small:Q8_0
- Lemonade
How to use Minibase/Detoxify-Language-Small with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Minibase/Detoxify-Language-Small:Q8_0
Run and chat with the model
lemonade run user.Detoxify-Language-Small-Q8_0
List all available models
lemonade list
- Atomic Chat
| # Usage Examples - Detoxify-Small | |
| ## Basic Usage | |
| ### 1. Start the Server | |
| ```bash | |
| ./run_server.sh | |
| ``` | |
| ### 2. Check Server Health | |
| ```bash | |
| curl http://127.0.0.1:8000/health | |
| ``` | |
| ### 3. Simple Completion | |
| ```bash | |
| curl -X POST http://127.0.0.1:8000/completion \ | |
| -H "Content-Type: application/json" \ | |
| -d '{ | |
| "prompt": "Instruction: Rewrite the provided text to remove the toxicity.\n\nInput: This is terrible!\n\nResponse: ", | |
| "max_tokens": 100, | |
| "temperature": 0.7 | |
| }' | |
| ``` | |
| ### 4. Streaming Response | |
| ```bash | |
| curl -X POST http://127.0.0.1:8000/completion \ | |
| -H "Content-Type: application/json" \ | |
| -d '{ | |
| "prompt": "Instruction: Rewrite the provided text to remove the toxicity.\n\nInput: This sucks so bad!\n\nResponse: ", | |
| "max_tokens": 500, | |
| "temperature": 0.8, | |
| "stream": true | |
| }' | |
| ``` | |
| ## Advanced Configuration | |
| ### Custom Server Settings | |
| ```bash | |
| llama-server \ | |
| -m model.gguf \ | |
| --host 127.0.0.1 \ | |
| --port 8000 \ | |
| --n-gpu-layers 35 \ | |
| --ctx-size 4096 \ | |
| --threads 8 \ | |
| --chat-template "" \ | |
| --log-disable | |
| ``` | |
| ### GPU Acceleration (macOS with Metal) | |
| ```bash | |
| llama-server \ | |
| -m model.gguf \ | |
| --host 127.0.0.1 \ | |
| --port 8000 \ | |
| --n-gpu-layers 50 \ | |
| --metal | |
| ``` | |
| ### GPU Acceleration (Linux/Windows with CUDA) | |
| ```bash | |
| llama-server \ | |
| -m model.gguf \ | |
| --host 127.0.0.1 \ | |
| --port 8000 \ | |
| --n-gpu-layers 50 \ | |
| --cuda | |
| ``` | |
| ## Python Client Example | |
| ```python | |
| import requests | |
| import json | |
| def complete_with_model(prompt, max_tokens=200, temperature=0.7): | |
| url = "http://127.0.0.1:8000/completion" | |
| payload = { | |
| "prompt": prompt, | |
| "max_tokens": max_tokens, | |
| "temperature": temperature | |
| } | |
| headers = { | |
| 'Content-Type': 'application/json' | |
| } | |
| response = requests.post(url, json=payload, headers=headers) | |
| if response.status_code == 200: | |
| result = response.json() | |
| return result['content'] | |
| else: | |
| return f"Error: {response.status_code}" | |
| # Example usage | |
| prompt = "Instruction: Rewrite the provided text to remove the toxicity.\n\nInput: This is awful!\n\nResponse: " | |
| response = complete_with_model(prompt) | |
| print(response) | |
| ``` | |
| ## Troubleshooting | |
| ### Common Issues | |
| 1. **Memory Errors** | |
| ``` | |
| Error: not enough memory | |
| ``` | |
| **Solution**: Reduce `--n-gpu-layers` to 0 or use a smaller value | |
| 2. **Context Window Too Large** | |
| ``` | |
| Error: context size exceeded | |
| ``` | |
| **Solution**: Reduce `--ctx-size` (e.g., `--ctx-size 2048`) | |
| 3. **CUDA Not Available** | |
| ``` | |
| Error: CUDA not found | |
| ``` | |
| **Solution**: Remove `--cuda` flag or install CUDA drivers | |
| 4. **Port Already in Use** | |
| ``` | |
| Error: bind failed | |
| ``` | |
| **Solution**: Use a different port with `--port 8001` | |
| ### Performance Tuning | |
| - **For faster inference**: Increase `--n-gpu-layers` | |
| - **For lower latency**: Reduce `--ctx-size` | |
| - **For better quality**: Lower `--temperature` and increase `--top-p` | |
| - **For creativity**: Increase `--temperature` and adjust `--top-k` | |
| ### System Requirements | |
| - **RAM**: Minimum 8GB, recommended 16GB+ | |
| - **GPU**: Optional but recommended for better performance | |
| - **Storage**: Model file size + 2x for temporary files | |
| --- | |
| Generated on 2025-09-17 20:07:11 | |