Instructions to use matu79go/Reflex-1-4B-bnb-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use matu79go/Reflex-1-4B-bnb-4bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="matu79go/Reflex-1-4B-bnb-4bit") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("matu79go/Reflex-1-4B-bnb-4bit") model = AutoModelForMultimodalLM.from_pretrained("matu79go/Reflex-1-4B-bnb-4bit", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use matu79go/Reflex-1-4B-bnb-4bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "matu79go/Reflex-1-4B-bnb-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": "matu79go/Reflex-1-4B-bnb-4bit", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/matu79go/Reflex-1-4B-bnb-4bit
- SGLang
How to use matu79go/Reflex-1-4B-bnb-4bit 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 "matu79go/Reflex-1-4B-bnb-4bit" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "matu79go/Reflex-1-4B-bnb-4bit", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "matu79go/Reflex-1-4B-bnb-4bit" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "matu79go/Reflex-1-4B-bnb-4bit", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use matu79go/Reflex-1-4B-bnb-4bit with Docker Model Runner:
docker model run hf.co/matu79go/Reflex-1-4B-bnb-4bit
Reflex-1-4B-bnb-4bit
Pre-quantized 4-bit (bitsandbytes NF4, double quantization) copy of Google Gemma 4 E4B for use as the base model of Reflex-1. Download is 9.3 GB instead of about 16 GB, and no quantization is needed at load time.
The vision/audio towers, embeddings and LM head are kept in bfloat16; the transformer blocks are NF4.
Variants
All Reflex-1 repositories: Reflex-1 collection
| Repository | What it is | Download | GPU memory |
|---|---|---|---|
| matu79go/Reflex-1-4B | The Reflex-1 skills (LoRA + latent modules) and registry. Needed for every variant | 1.8 GB | — |
| matu79go/Reflex-1-4B-bnb-4bit (this page) | Base model, pre-quantized 4-bit NF4. Recommended | 9.3 GB | ~10 GB |
| google/gemma-4-E4B-it | Base model, original BF16 (quantize at load with --quant nf4, or run in BF16 with --quant none) |
~16 GB | ~10 GB / ~16 GB |
Usage
git clone https://github.com/matu79go/reflex-1.git && cd reflex-1
pip install -r requirements.txt
python -m reflex.server --base matu79go/Reflex-1-4B-bnb-4bit --skills skills.json --port 8097
Results with this base are the same as quantizing google/gemma-4-E4B-it at load time (checked on intent classification, image classification and the three reasoning skills).
License
Apache License 2.0. Derived from Google Gemma 4 E4B (Apache 2.0); only quantized, no other changes. Not affiliated with or endorsed by Google.
- Downloads last month
- 24