Image-Text-to-Text
GGUF
rknn
rockchip
rk3588
rk1820
intern-decision
multimodal
decision
npu
conversational
Instructions to use wardner/Intern_Decision-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use wardner/Intern_Decision-4B with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf wardner/Intern_Decision-4B # Run inference directly in the terminal: llama cli -hf wardner/Intern_Decision-4B
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf wardner/Intern_Decision-4B # Run inference directly in the terminal: llama cli -hf wardner/Intern_Decision-4B
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf wardner/Intern_Decision-4B # Run inference directly in the terminal: ./build/bin/llama cli -hf wardner/Intern_Decision-4B
Use Docker
docker model run hf.co/wardner/Intern_Decision-4B
- Llama new
- LM Studio
- Jan
- vLLM
How to use wardner/Intern_Decision-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "wardner/Intern_Decision-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": "wardner/Intern_Decision-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/wardner/Intern_Decision-4B
- Ollama
How to use wardner/Intern_Decision-4B with Ollama:
ollama run hf.co/wardner/Intern_Decision-4B
- Unsloth Desktop
- Pi
How to use wardner/Intern_Decision-4B with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf wardner/Intern_Decision-4B
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "wardner/Intern_Decision-4B" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use wardner/Intern_Decision-4B with Docker Model Runner:
docker model run hf.co/wardner/Intern_Decision-4B
- Lemonade
How to use wardner/Intern_Decision-4B with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull wardner/Intern_Decision-4B
Run and chat with the model
lemonade run user.Intern_Decision-4B-{{QUANT_TAG}}List all available models
lemonade list
- Hermes Agent
How to use wardner/Intern_Decision-4B with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf wardner/Intern_Decision-4B
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:9931/v1 hermes config set model.default wardner/Intern_Decision-4B
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use wardner/Intern_Decision-4B with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf wardner/Intern_Decision-4B
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:9931/v1 \ --custom-model-id "wardner/Intern_Decision-4B" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Upload intern-decision-4b.json
Browse files- intern-decision-4b.json +20 -0
intern-decision-4b.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"label": "[JEV]图像文字决策模型4B",
|
| 3 |
+
"capability_types": [
|
| 4 |
+
"swcap_decision"
|
| 5 |
+
],
|
| 6 |
+
"spec_factory": "intern_decision_4b",
|
| 7 |
+
"worker_name": "intern-dec",
|
| 8 |
+
"model_dir_name": "Intern_Decision-4B",
|
| 9 |
+
"model_dir_env": "WDNAI_INTERN_DECISION_4B_DIR",
|
| 10 |
+
"instance_name": "decision-intern4b",
|
| 11 |
+
"memory_estimate_mb": 3200,
|
| 12 |
+
"estimated_init_seconds": 60,
|
| 13 |
+
"infer_timeout_s": 120,
|
| 14 |
+
"description": "Intern-Decision-4B 结构化决策模型(状态→分类/是非/评分,实测单次纯文本决策 ~1.1s、图文决策 ~9s)",
|
| 15 |
+
"notes": "⚠️ **它不是对话模型**:Intern-Decision 不生成文本 —— 每个决策字段输出的是 62 个候选符号(A-Z + a-z + 0-9)的 logits,由 CPU 侧换算成选项概率。调用方要传**任务配置**(task=):字段类型 choice(选一项)/ score(选项键是数字,输出概率加权评分)/ noul(是否,输出肯定概率)。答案 JSON 形如 {\"category\": \"account\", \"urgency\": 0.7676},完整概率 / logits 随 TextAttachment 一起回传。⚠️ **prompt 里的 ChatML 标记是「写进文本」的,不是模板**:完整形态是 <|im_start|>system\\n…<|im_end|>\\n<|im_start|>user\\n…<|im_end|>\\n<|im_start|>assistant\\n<think>\\n\\n</think>\\n\\n{骨架}<|im_end|>\\n;少写这 6 个标记就少 66 字节 / 6 个 token,token 位置整体错位、概率明显偏移。C 侧的 chat template 被**显式清空**(官方 demo 从不调 set_chat_template,它默认就是空的)。⚠️ **预分词正则按 GGUF 的 tokenizer.ggml.pre 选**:这个模型是 qwen35,ByteLevel 自带的 GPT-2 正则会把 e.g. 切成 4 个 token 而不是 3 个 → token id 整体错位。⚠️ **每个字段一次 prefill,且必须换 session**:模型有 linear-attention 层,递归状态跨调用残留,keep_history=0 只清 KV cache 不清递归状态 —— C++ 参考实现每个字段都 rknn3_session_init/destroy,wdnai 用 RKNN3Lite.recreate_llm_session() 复刻。⚠️ **控制 token 必须是单 token**:<decision>=248077、<think>=248068、</think>=248069,ByteLevel 预分词器会把它们拆开,所以 wdnai 在**本模型的 tokenizer 实例上**单独注册(不动 Qwen 全局 tokenizer —— Qwen 路径靠解码文本里的字面量切 thinking 通道);追加时必须**合并**而不是替换 additional_special_tokens(add_special_tokens 是整体替换,会把 Qwen 的 <|vision_start|>/<|image_pad|> 踢掉 → C 库定位不到图片占位区 → 图文 prompt 少喂 6 个 token)。⚠️ **单卡可同驻留 LLM + vision**:实测一张 1828 协卡上 LLM(weight 2013MB + internal 44MB + kvcache 297MB)与 vision(weight 651MB + internal 65MB)**同时驻留**,每个 NPU 节点用量 296MB → 383MB(节点总量 ~640MB,余量充足)。视觉模型**按需加载**(第一次带图的请求才加载)、编码完即释放(对齐 C++ 参考实现),可用 spec.options['keep_vision_resident']=True 改成常驻。视觉预处理是**整幅拉伸 resize** 到 384×384(不是 letterbox),归一化已烙进模型,只送原始 RGB 字节;缩放走 **RGA 硬件**(wdnai._rga,ctypes 直调 librga),与官方 image_utils.c 的 convert_image 一致(RGA 插值 ≠ OpenCV INTER_LINEAR,像素最大差 136)。⚠️ 概率校准温度按 embedding 宽度查表(4B = 1.99241824,float32 实际值 1.9924182891845703),运行时从 RKNN 内嵌的 LLM_CONFIG 自动读 embedding_dim 选取;校准全程 float32(参考实现用 C float)。✅ **与官方 C++ demo 逐位一致**(2026-11-13 真机对拍,官方 demo 在本板 aarch64 编译):prompt 字节(1063 / 2861)、token id 序列(251 / 374)、原始 logits、校准概率、评分、温度全部一致;图文在喂官方自己解码的像素时同样逐位一致(SDK 自带解码只剩 JPEG 解码器差异,概率差 ≤0.03pp)。词表参数:vocab_size=248320、eos=248046、max_context_len=4096(导出时的值)。",
|
| 16 |
+
"available_targets": [
|
| 17 |
+
"182x"
|
| 18 |
+
],
|
| 19 |
+
"display_order": 91
|
| 20 |
+
}
|