Instructions to use occ-ai/OCC-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use occ-ai/OCC-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="occ-ai/OCC-4B") 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("occ-ai/OCC-4B") model = AutoModelForMultimodalLM.from_pretrained("occ-ai/OCC-4B", 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 occ-ai/OCC-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "occ-ai/OCC-4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "occ-ai/OCC-4B", "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/occ-ai/OCC-4B
- SGLang
How to use occ-ai/OCC-4B 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 "occ-ai/OCC-4B" \ --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": "occ-ai/OCC-4B", "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 "occ-ai/OCC-4B" \ --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": "occ-ai/OCC-4B", "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 occ-ai/OCC-4B with Docker Model Runner:
docker model run hf.co/occ-ai/OCC-4B
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoProcessor, AutoModelForMultimodalLM
processor = AutoProcessor.from_pretrained("occ-ai/OCC-4B")
model = AutoModelForMultimodalLM.from_pretrained("occ-ai/OCC-4B", 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]:]))
Technical Report | GitHub | GGUF | ONNX
OCC-4B
OCC-4B is our first general-purpose agentic model, built for long-running assistant tasks that combine user interaction and tool use, with a focus on multi-turn workflows and iterative search.
Highlights
- Agentic training. Fine-tuned for agentic tasks and supports both instruct and thinking modes.
- Function calling. Natively supports function calling, taking actions across multiple tools as the conversation unfolds.
- Search. Answers questions through iterative search across diverse sources, using each finding to guide the next query and connect evidence along the way.
Instruct mode (default)
Thinking mode
Performance
Instruct
search to retrieve result snippets, open to read pages, and find to locate text within a page.Thinking
reasoning_effort=medium.search to retrieve result snippets, open to read pages, and find to locate text within a page.Subagent Orchestration (Preview)
OCC-4B can also direct subagents: it runs several copies of itself in parallel and combines their answers into the final response, improving on a single agent.
new to start a subagent session, send to send it a prompt, and wait to receive the next reply. Each subagent is OCC-4B with the same search, open and find tools as the single agent. The two manager columns differ only in the manager model.Quickstart
OCC-4B keeps the architecture and chat template of Qwen3.5-4B, so it runs anywhere Qwen3.5-4B runs. It supports both
instruct and thinking modes. Instruct is the default and recommended mode. To enable thinking, pass enable_thinking: true in the chat template arguments.
vLLM
vllm serve occ-ai/OCC-4B \
--port 8000 \
--max-model-len 262144 \
--reasoning-parser qwen3 \
--enable-auto-tool-choice \
--tool-call-parser qwen3_coder
Add --language-model-only to skip the vision encoder and free memory for the KV cache.
SGLang
python -m sglang.launch_server \
--model-path occ-ai/OCC-4B \
--port 8000 \
--context-length 262144 \
--reasoning-parser qwen3 \
--tool-call-parser qwen3_coder
Both commands start an OpenAI-compatible server at http://localhost:8000/v1.
Function calling
from openai import OpenAI
client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")
tools = [{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather for a city.",
"parameters": {
"type": "object",
"properties": {"city": {"type": "string"}},
"required": ["city"],
},
},
}]
response = client.chat.completions.create(
model="occ-ai/OCC-4B",
messages=[{"role": "user", "content": "What's the weather in Moscow?"}],
tools=tools,
temperature=0.7,
top_p=0.8,
extra_body={"top_k": 20},
)
print(response.choices[0].message.tool_calls)
Transformers
import torch
from transformers import AutoModelForImageTextToText, AutoProcessor
model_id = "occ-ai/OCC-4B"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForImageTextToText.from_pretrained(model_id, dtype=torch.bfloat16, device_map="auto")
messages = [{"role": "user", "content": [{"type": "text", "text": "Plan a three-day trip to Kazan."}]}]
inputs = processor.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
enable_thinking=False, # set to True for thinking mode
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=32768, do_sample=True, temperature=0.7, top_p=0.8, top_k=20)
print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
Recommended sampling parameters
We recommend using the following sampling parameters for generation:
- Instruct mode:
temperature=0.7, top_p=0.8, top_k=20, min_p=0.0, presence_penalty=0.0, repetition_penalty=1.0- Thinking mode:
temperature=0.6, top_p=0.95, top_k=20, min_p=0.0, presence_penalty=0.0, repetition_penalty=1.0Please note that the support for sampling parameters varies according to inference frameworks.
License
OCC-4B is released under the Apache 2.0 License. It is fine-tuned from Qwen3.5-4B, which is also licensed under Apache 2.0. Only the language model is fine-tuned; the vision components are inherited from Qwen3.5-4B unchanged.
Citation
If you find our work helpful, feel free to give us a cite.
@misc{occ4b,
title = {{OCC-4B} Technical Report},
author = {{OCC AI}},
month = {November},
year = {2026},
url = {https://github.com/optimal-cognitive-core/OCC/blob/main/OCC_Technical_Report.pdf}
}
- Downloads last month
- 2
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="occ-ai/OCC-4B") 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)