Instructions to use SirSahOl/LocateAnything-3B-mlx-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use SirSahOl/LocateAnything-3B-mlx-4bit with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("SirSahOl/LocateAnything-3B-mlx-4bit") config = load_config("SirSahOl/LocateAnything-3B-mlx-4bit") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Transformers
How to use SirSahOl/LocateAnything-3B-mlx-4bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="SirSahOl/LocateAnything-3B-mlx-4bit", trust_remote_code=True) 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForSeq2SeqLM model = AutoModelForSeq2SeqLM.from_pretrained("SirSahOl/LocateAnything-3B-mlx-4bit", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- vLLM
How to use SirSahOl/LocateAnything-3B-mlx-4bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SirSahOl/LocateAnything-3B-mlx-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": "SirSahOl/LocateAnything-3B-mlx-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/SirSahOl/LocateAnything-3B-mlx-4bit
- SGLang
How to use SirSahOl/LocateAnything-3B-mlx-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 "SirSahOl/LocateAnything-3B-mlx-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": "SirSahOl/LocateAnything-3B-mlx-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 "SirSahOl/LocateAnything-3B-mlx-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": "SirSahOl/LocateAnything-3B-mlx-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 SirSahOl/LocateAnything-3B-mlx-4bit with Docker Model Runner:
docker model run hf.co/SirSahOl/LocateAnything-3B-mlx-4bit
- Atomic Chat
LocateAnything-3B-mlx-4bit
4-bit MLX conversion of nvidia/LocateAnything-3B optimized for Apple Silicon native GPU inference.
Converted by: SirSahOl
Source Model: nvidia/LocateAnything-3B
Framework: MLX by Apple
Quantization: 4-bit (Average 4.50 bits per weight)
Format: safetensors
License: other
Model Details
Architecture: LocateAnythingForConditionalGeneration
Parameters: 3B
Context Length: 32,768 tokens
Format: MLX (Apple Silicon native GPU format)
Quantization: 4-bit (Average 4.50 bits per weight)
Active VRAM Footprint: ~2.0 GB (Minimum recommended: 8 GB Unified Memory)
Mixed Precision Strategy: Language backbone: 4-bit affine; Vision encoder: BF16 unquantized (maintains sub-pixel coordinate alignment for visual grounding)
Coordinate Output Format: Normalized
[ymin, xmin, ymax, xmax]in[0, 1000]range
Quick Start
Installation
pip install mlx-vlm
Usage
CLI
# Generate visual grounding completion
python -m mlx_vlm.generate --model SirSahOl/LocateAnything-3B-mlx-4bit --image screenshot.png --prompt "locate: submit button"
Python API (LocateAnything / Visual Grounding)
from mlx_vlm import load, generate
from mlx_vlm.utils import load_image
# Load model natively onto Apple Silicon GPU (Metal)
model, processor = load("SirSahOl/LocateAnything-3B-mlx-4bit")
prompt = "locate: submit button"
image_path = "screenshot.png"
# Format messages using the Qwen/LocateAnything vision template
messages = [
{
"role": "user",
"content": [
{"type": "image"},
{"type": "text", "text": prompt}
]
}
]
formatted_prompt = processor.apply_chat_template(messages, add_generation_prompt=True)
# Generate bounding box coordinates [ymin, xmin, ymax, xmax] normalized 0-1000
result = generate(model, processor, prompt=formatted_prompt, image=image_path, verbose=False)
print("Detected bounding box:", result.text)
Performance Benchmarks
Measured Benchmarks (Apple M1)
| Metric | 4-bit |
|---|---|
| Tokens/sec | 25.0 |
| TTFT | 150.0 ms |
| Peak Memory | 1439.4 MB |
Benchmarked on Apple M1 with 8GB unified memory. Average over 5 runs with 20 max tokens.
Multi-Quantization Comparison
Evaluate your hardware budget and choose the optimal precision:
| Variant | Disk Size | VRAM Footprint | Target Apple Silicon Hardware | Key Advantage |
|---|---|---|---|---|
| 4-bit MLX (This Repository) | ~2.0 GB | ~2.0 GB | M1 / M2 / M3 / M4 (8GB+) | Maximum generation speed and lowest RAM overhead. |
| 8-bit MLX | ~3.6 GB | ~3.6 GB | M1 / M2 / M3 / M4 Pro/Max (16GB+) | Balanced accuracy and generation speed; near-lossless reasoning. |
| 16-bit MLX | ~6.8 GB | ~6.8 GB | M2 / M3 / M4 Max/Ultra (32GB+) | Full unquantized precision; reference evaluation quality. |
Who Should Use This?
| Your Hardware | Recommended Quantization |
|---|---|
| M1/M2/M3/M4 (8GB – 16GB) | 4-bit — Best balance of speed, low memory, and multitasking capability |
| M1/M2/M3/M4 Pro/Max (18GB – 36GB) | 8-bit — Higher quality reasoning with comfortable memory headroom |
| M1/M2/M3/M4 Max/Ultra (36GB – 192GB) | 16-bit — Unquantized full precision, zero quality degradation |
General guidance:
- Use 4-bit if you want to run this model alongside IDEs, browsers, and background development tools.
- Use 8-bit if you have 16GB+ unified memory and require superior reasoning and code accuracy.
- Use 16-bit for research, benchmarking, evaluation, or high-end workstation deployments.
Other Quantization Variants
| Variant | Link |
|---|---|
| 4-bit | SirSahOl/LocateAnything-3B-mlx-4bit |
LM Studio & Local Inference Setup Guide
To prevent runaway loops and ensure correct conversational turn-taking, configure custom stop tokens in your local inference runtime:
<|im_start|><|im_end|><|endoftext|>
Prompt Template Formatting
- System Prefix:
<|im_start|>system\n - System Suffix:
<|im_end|>\n - User Prefix:
<|im_start|>user\n - Assistant Suffix:
<|im_end|>\n<|im_start|>assistant\n
Ollama Quickstart
FROM SirSahOl/LocateAnything-3B-mlx-4bit
PARAMETER stop "<|im_start|>"
PARAMETER stop "<|im_end|>"
PARAMETER stop "<|endoftext|>"
PARAMETER temperature 0.7
ollama create locateanything-3b-mlx-4bit -f Modelfile
ollama run locateanything-3b-mlx-4bit
Conversion Details
| Property | Value |
|---|---|
| Source Model | nvidia/LocateAnything-3B |
| Quantization | 4-bit |
| mlx-lm Version | N/A |
| Conversion Time | 14.27s |
| Output Size | 2.4 GB |
| Date | 2026-10-14T09:20:31.824464+00:00 |
Reproduction
To reproduce this conversion:
pip install mlx-lm==latest
python3 -m mlx_vlm convert --hf-path nvidia/LocateAnything-3B --mlx-path output/LocateAnything-3B-mlx-4bit --trust-remote-code -q --q-bits 4 --q-group-size 64
Limitations & Known Issues
- 4-bit group-wise quantization introduces minor precision loss compared to unquantized weights; for deep mathematical derivations or precision-critical reasoning, test the 8-bit or 16-bit variants.
- High context sequences (>32K tokens) require sufficient unified memory headroom; ensure unified memory is not overcommitted.
- This is a weight-only MLX conversion designed specifically for Apple Silicon GPUs (M1/M2/M3/M4 series).
License
This model conversion inherits the license of the source model: other.
See the original model card for full license details.
Changelog
| Version | Date | Changes |
|---|---|---|
| v1.0 | 2026-10-14 | Initial conversion |
Converted with MLX Foundry — a professional pipeline for converting models to Apple MLX format.
- Downloads last month
- -
4-bit