Image-Text-to-Text
Transformers
Safetensors
English
qwen3_5
qwen3.5
tool-use
agent
weight-space
dgx-spark
javi
conversational
Instructions to use javierbits/Javi0.4-2B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use javierbits/Javi0.4-2B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="javierbits/Javi0.4-2B") 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 AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("javierbits/Javi0.4-2B") model = AutoModelForMultimodalLM.from_pretrained("javierbits/Javi0.4-2B", 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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use javierbits/Javi0.4-2B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "javierbits/Javi0.4-2B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "javierbits/Javi0.4-2B", "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/javierbits/Javi0.4-2B
- SGLang
How to use javierbits/Javi0.4-2B 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 "javierbits/Javi0.4-2B" \ --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": "javierbits/Javi0.4-2B", "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 "javierbits/Javi0.4-2B" \ --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": "javierbits/Javi0.4-2B", "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 javierbits/Javi0.4-2B with Docker Model Runner:
docker model run hf.co/javierbits/Javi0.4-2B
|
Download README.md from javierbits/Javi0.4-2B: direct link, hf CLI and curl.
- Browser
- Download file 4.77 kB
-
https://huggingface.co/javierbits/Javi0.4-2B/resolve/main/README.md
- Command line
-
hf download hf://javierbits/Javi0.4-2B/README.md
-
curl -L -o README.md https://huggingface.co/javierbits/Javi0.4-2B/resolve/main/README.md
4.77 kB
| license: apache-2.0 | |
| language: | |
| - en | |
| base_model: javierbits/Javi0.3-2B | |
| base_model_relation: finetune | |
| pipeline_tag: image-text-to-text | |
| library_name: transformers | |
| tags: | |
| - qwen3.5 | |
| - tool-use | |
| - agent | |
| - weight-space | |
| - dgx-spark | |
| - javi | |
|  | |
| # Javi0.4-2B | |
| Javi0.4-2B is **Javi0.3-2B with one embedding row changed**. No fine-tuning, no new data, no gradients. The tied input/output row for token 51187 (`=open_page`) is multiplied by 0.84. Every other weight is byte-identical to Javi0.3-2B. | |
| The edit biases one decision: after a failed lookup, call `web_search` again instead of opening a URL typed from memory. It does not add a new reasoning capability. | |
| ## Measured effect | |
| 8 held-out eval-v3 canonical `fail` questions, first `web_search` forced to fail, greedy next tool: | |
| | model | next `web_search` | next `open_page` | | |
| |---|---:|---:| | |
| | Javi0.3-2B | 0/8 | 8/8 | | |
| | Javi0.4-2B | 7/8 | 1/8 | | |
| This probe isolates the decision the edit targets. In a two-seed harness canary with real tools and sampling, 0.84 chose `open_page` after a permanently blocked search and completed, same as the base; it used one extra search on a normal lookup. A 0.75 scale flipped 4/4 but looped on 14 searches under a permanent block, so 0.84 is the conservative setting. The edit reaches the canonical `open_page` tool; in opencode/grok, `webfetch`/`web_fetch` after a 403 is unchanged. | |
| ### Full eval v3 | |
| 175 held-out seeds, 3 runs, date pin 2026-10-07, cached search results. Javi0.3-2B answers on the same seeds are the baseline. Judges: DeepSeek-V4.1-Flash-1017 and mimo-v26-dual. | |
| | metric | Javi0.3-2B | Javi0.4-2B | | |
| |---|---:|---:| | |
| | core pass (judge average) | 0.35 [0.30, 0.40] | 0.41 [0.36, 0.45] | | |
| | core pass (deepseek) | 0.48 | 0.58 | | |
| | core pass (mimo) | 0.23 | 0.24 | | |
| | recovery after a tool failure | 0.55 (n=11) | 0.45 (n=10) | | |
| | made-up links | 0.01 | 0.00 | | |
| | loops | 0.04 | 0.03 | | |
| Paired core pass difference: **+0.06 [0.02, 0.10]** (deepseek +0.10 [0.05, 0.16], mimo +0.02 [-0.02, 0.06]), 95% bootstrap over 175 seeds. The deepseek interval clears zero; the mimo interval crosses zero, so the size of the gain is uncertain. Conflict questions improved (0.33 vs 0.07, n=7) and nodate (0.42 vs 0.17, n=6); premise (0.23 vs 0.29, n=13) and recovery after real failures did not. | |
| Five answer episodes (4 seeds) carry no deepseek verdict because the judge omits the `tools` or `style` key; one seed never finished an episode in any of the three runs and the judge skips it, so judge-only rows cover 174 seeds. Core pass stays at 175 seeds with incomplete episodes scored 0. Full scoreboard: `data/v2/eval/javi04-vs-03-2b/score.md` in the source tree. | |
| ## Files | |
| Merged bf16 safetensors (one shard, 4.2 GB), tokenizer, processor files and chat template. The vision tower is Qwen3.5-2B's, unchanged; the edit is in the language model only. | |
| ## Run it | |
| Javi was trained and evaluated with thinking off. Send `"chat_template_kwargs": {"enable_thinking": false}` and use temperature 0.2, top-p 0.8, top-k 20 so tool calls stay well formed. | |
| **GGUF** for llama.cpp or lmdeck: [Javi0.4-2B-GGUF](https://huggingface.co/javierbits/Javi0.4-2B-GGUF). | |
| **lmdeck** | |
| ```bash | |
| lmdeck use javi0.4-2b | |
| ``` | |
| **Transformers** | |
| ```python | |
| from transformers import AutoModelForImageTextToText, AutoProcessor | |
| model_id = "javierbits/Javi0.4-2B" | |
| processor = AutoProcessor.from_pretrained(model_id) | |
| model = AutoModelForImageTextToText.from_pretrained(model_id, dtype="auto", device_map="auto") | |
| tools = [{"type": "function", "function": { | |
| "name": "web_search", "description": "Search the web.", | |
| "parameters": {"type": "object", "properties": {"query": {"type": "string"}}, "required": ["query"]}}}] | |
| messages = [{"role": "user", "content": [{"type": "text", "text": "What's the latest stable Rust release?"}]}] | |
| inputs = processor.apply_chat_template(messages, tools=tools, add_generation_prompt=True, enable_thinking=False, | |
| tokenize=True, return_dict=True, return_tensors="pt").to(model.device) | |
| out = model.generate(**inputs, max_new_tokens=512, do_sample=True, temperature=0.2, top_p=0.8, top_k=20) | |
| print(processor.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)) | |
| ``` | |
| ## The edit | |
| ```python | |
| embed_tokens[51187] *= 0.84 # =open_page | |
| ``` | |
| Token 51187 is a single token in the Qwen3.5 tokenizer. The row is tied between input and output embeddings, so the output logit for `=open_page` is reduced. | |
| ## Links | |
| - Base: [Javi0.3-2B](https://huggingface.co/javierbits/Javi0.3-2B) | |
| - 4B control: [Javi0.4-4B](https://huggingface.co/javierbits/Javi0.4-4B) | |
| - Apache 2.0, inherited from [Qwen3.5-2B](https://huggingface.co/Qwen/Qwen3.5-2B). | |