Image-Text-to-Text
Transformers
Safetensors
English
locateanything
feature-extraction
nvidia
eagle
vision
object-detection
grounding
conversational
custom_code
Instructions to use Akfmsk/LocateAnything-3B-custom with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Akfmsk/LocateAnything-3B-custom with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Akfmsk/LocateAnything-3B-custom", 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 AutoModel model = AutoModel.from_pretrained("Akfmsk/LocateAnything-3B-custom", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Akfmsk/LocateAnything-3B-custom with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Akfmsk/LocateAnything-3B-custom" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Akfmsk/LocateAnything-3B-custom", "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/Akfmsk/LocateAnything-3B-custom
- SGLang
How to use Akfmsk/LocateAnything-3B-custom 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 "Akfmsk/LocateAnything-3B-custom" \ --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": "Akfmsk/LocateAnything-3B-custom", "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 "Akfmsk/LocateAnything-3B-custom" \ --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": "Akfmsk/LocateAnything-3B-custom", "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 Akfmsk/LocateAnything-3B-custom with Docker Model Runner:
docker model run hf.co/Akfmsk/LocateAnything-3B-custom
Commit History
-
Guarantee completely safe memory bounds by chunking to 1024 and compiling every single layer independently, preventing the XLA scheduler from overlapping chunk lifetimes across layers
7976ec3 -
Revert padding and use a 4-chunk Memory-Efficient Attention to perfectly balance the 4.2GB peak memory and 16-node XLA graph size, compiling instantly without OOMing the TPU or Host RAM
5aa7afb -
Fix severe XLA compiler memory leak and 10-minute hang by padding both head_dim and seq_len to multiples of 128 to perfectly satisfy the TPU Flash Attention kernel, completely eliminating the fallback graph explosion
fe892dd -
Implement manual Memory-Efficient Attention by chunking the Query sequence dimension to forcefully bound the memory of PyTorch XLA's naive fallback kernel from 17.2 GB down to safe 1 GB blocks
2e46ef6 -
Pad head_dim from 72 to 128 to trick PyTorch XLA into mapping the attention calculation to the highly-optimized Pallas TPU Flash Attention kernel, completely avoiding the catastrophic O(N^2) memory fallback
8f6ba09 -
Trigger PyTorch XLA Flash Attention kernel natively by calling F.scaled_dot_product_attention without any explicit masks or eager math, resolving the 8.26GB Out-Of-Memory failure and restoring the chunked graph execution
d72b51f -
Inject xm.mark_step() every 4 layers inside the Vision Model encoder to prevent PyTorch XLA from accumulating 8.3GB of intermediate activations during graph compilation and execution
703d98a -
Defeat XLA compiler graph rewriter by injecting mathematical fusion breakers into the vision model batched matmuls, preventing XLA from aggressively flattening them back into a single massive 16416x16416 SDPA
672baa4 -
Fix massive OOM in the vision model by replacing the 16416x16416 block-diagonal attention mask with a memory-efficient batched slice SDPA
e640dfc
-
Initial snapshot
d979fab