Instructions to use wyan/usenet-gemma-4-E2B-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use wyan/usenet-gemma-4-E2B-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("google/gemma-4-E2B") model = PeftModel.from_pretrained(base_model, "wyan/usenet-gemma-4-E2B-lora") - Transformers
How to use wyan/usenet-gemma-4-E2B-lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="wyan/usenet-gemma-4-E2B-lora")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("wyan/usenet-gemma-4-E2B-lora", dtype="auto") - llama-cpp-python
How to use wyan/usenet-gemma-4-E2B-lora with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="wyan/usenet-gemma-4-E2B-lora", filename="usenet-gemma-v0.01.Q4_K_M.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use wyan/usenet-gemma-4-E2B-lora with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf wyan/usenet-gemma-4-E2B-lora:Q4_K_M # Run inference directly in the terminal: llama-cli -hf wyan/usenet-gemma-4-E2B-lora:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf wyan/usenet-gemma-4-E2B-lora:Q4_K_M # Run inference directly in the terminal: llama-cli -hf wyan/usenet-gemma-4-E2B-lora: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 wyan/usenet-gemma-4-E2B-lora:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf wyan/usenet-gemma-4-E2B-lora: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 wyan/usenet-gemma-4-E2B-lora:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf wyan/usenet-gemma-4-E2B-lora:Q4_K_M
Use Docker
docker model run hf.co/wyan/usenet-gemma-4-E2B-lora:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use wyan/usenet-gemma-4-E2B-lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "wyan/usenet-gemma-4-E2B-lora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "wyan/usenet-gemma-4-E2B-lora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/wyan/usenet-gemma-4-E2B-lora:Q4_K_M
- SGLang
How to use wyan/usenet-gemma-4-E2B-lora 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 "wyan/usenet-gemma-4-E2B-lora" \ --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": "wyan/usenet-gemma-4-E2B-lora", "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 "wyan/usenet-gemma-4-E2B-lora" \ --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": "wyan/usenet-gemma-4-E2B-lora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use wyan/usenet-gemma-4-E2B-lora with Ollama:
ollama run hf.co/wyan/usenet-gemma-4-E2B-lora:Q4_K_M
- Unsloth Studio new
How to use wyan/usenet-gemma-4-E2B-lora 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 wyan/usenet-gemma-4-E2B-lora 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 wyan/usenet-gemma-4-E2B-lora to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for wyan/usenet-gemma-4-E2B-lora to start chatting
- Docker Model Runner
How to use wyan/usenet-gemma-4-E2B-lora with Docker Model Runner:
docker model run hf.co/wyan/usenet-gemma-4-E2B-lora:Q4_K_M
- Lemonade
How to use wyan/usenet-gemma-4-E2B-lora with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull wyan/usenet-gemma-4-E2B-lora:Q4_K_M
Run and chat with the model
lemonade run user.usenet-gemma-4-E2B-lora-Q4_K_M
List all available models
lemonade list
Notes from the dataset creator - tips for better fine-tuning
This is fantastic! Really glad to see someone actually shipping something with the corpus. A few thoughts that might help with the "works terribly" problem:
For a Usenet-flavored model, the comp.* and sci.* samples will give you much cleaner signal than alt.* — the alt hierarchy has a lot of noise and the writing style is all over the place. If you haven't already, try fine-tuning on just the comp-sample or sci-sample files and see if the output quality improves noticeably.
Also worth filtering by date if you can... the pre-1995 posts have a very distinct voice (longer, more technical, less conversational) compared to the late 90s material. Depending on which era you're going for, mixing those can confuse the model.
Keep iterating! The fact that you got a quantized GGUF running on ollama with downloads already is great progress. Happy to answer any questions about the data structure or content if it would help.
Thank you for your encouragement!
I must admit I don't really know what I'm doing, this is my first time tuning models or running any ML at all, and I'm learning as I go. I'll try your suggestions. One thing I still don't quite get is what's the "correct" format to give the data to feed the tuning process. This attempt uses the subject line as a sort of question and the body as an answer, which I'm guessing makes it more like reinforcement learning and less like the fine tuning we want here. Need to read up on this.
I'm hoping to find some time to give it another go soon, it's pretty impressive in any case to be able to play with this sort of algorithm, at this size, as a hobby :)