Instructions to use Intelligent-Internet/II-Search-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Intelligent-Internet/II-Search-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Intelligent-Internet/II-Search-4B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Intelligent-Internet/II-Search-4B") model = AutoModelForCausalLM.from_pretrained("Intelligent-Internet/II-Search-4B") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Intelligent-Internet/II-Search-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Intelligent-Internet/II-Search-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": "Intelligent-Internet/II-Search-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Intelligent-Internet/II-Search-4B
- SGLang
How to use Intelligent-Internet/II-Search-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 "Intelligent-Internet/II-Search-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": "Intelligent-Internet/II-Search-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "Intelligent-Internet/II-Search-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": "Intelligent-Internet/II-Search-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Intelligent-Internet/II-Search-4B with Docker Model Runner:
docker model run hf.co/Intelligent-Internet/II-Search-4B
Update README.md
Browse files
README.md
CHANGED
|
@@ -46,8 +46,8 @@ We applied:
|
|
| 46 |
### Phase 4: Reinforcement Learning
|
| 47 |
|
| 48 |
We trained the model using reinforcement learning
|
| 49 |
-
-
|
| 50 |
-
- Incorporated our in-house search database (containing Wiki data, Fineweb data, and
|
| 51 |
|
| 52 |
## Performance
|
| 53 |
|
|
@@ -81,6 +81,7 @@ II-Search-4B is designed for:
|
|
| 81 |
## Usage
|
| 82 |
To deploy and interact with the II-Search-4B model effectively, follow these options:
|
| 83 |
1. Serve the model using vLLM or SGLang
|
|
|
|
| 84 |
Use the following command to serve the model with vLLM (adjust parameters as needed for your hardware setup):
|
| 85 |
```bash
|
| 86 |
vllm serve Intelligent-Internet/II-Search-4B --served-model-name II-Search-4B --tensor-parallel-size 8 --enable-reasoning --reasoning-parser deepseek_r1 --rope-scaling '{"rope_type":"yarn","factor":1.5,"original_max_position_embeddings":98304}' --max-model-len 131072
|
|
@@ -88,6 +89,7 @@ vllm serve Intelligent-Internet/II-Search-4B --served-model-name II-Search-4B --
|
|
| 88 |
This configuration enables distributed tensor parallelism across 8 GPUs, reasoning capabilities, custom RoPE scaling for extended context, and a maximum context length of 131,072 tokens.
|
| 89 |
|
| 90 |
2. Integrate web_search and web_visit tools
|
|
|
|
| 91 |
Equip the served model with web_search and web_visit tools to enable internet-aware functionality. Alternatively, use a middleware like MCP for tool integration—see this example repository: https://github.com/hoanganhpham1006/mcp-server-template.
|
| 92 |
|
| 93 |
## Host on macOS with MLX for local use
|
|
|
|
| 46 |
### Phase 4: Reinforcement Learning
|
| 47 |
|
| 48 |
We trained the model using reinforcement learning
|
| 49 |
+
- Used dataset: [dgslibisey/MuSiQue](https://huggingface.co/datasets/dgslibisey/MuSiQue)
|
| 50 |
+
- Incorporated our in-house search database (containing Wiki data, Fineweb data, and ArXiv data)
|
| 51 |
|
| 52 |
## Performance
|
| 53 |
|
|
|
|
| 81 |
## Usage
|
| 82 |
To deploy and interact with the II-Search-4B model effectively, follow these options:
|
| 83 |
1. Serve the model using vLLM or SGLang
|
| 84 |
+
|
| 85 |
Use the following command to serve the model with vLLM (adjust parameters as needed for your hardware setup):
|
| 86 |
```bash
|
| 87 |
vllm serve Intelligent-Internet/II-Search-4B --served-model-name II-Search-4B --tensor-parallel-size 8 --enable-reasoning --reasoning-parser deepseek_r1 --rope-scaling '{"rope_type":"yarn","factor":1.5,"original_max_position_embeddings":98304}' --max-model-len 131072
|
|
|
|
| 89 |
This configuration enables distributed tensor parallelism across 8 GPUs, reasoning capabilities, custom RoPE scaling for extended context, and a maximum context length of 131,072 tokens.
|
| 90 |
|
| 91 |
2. Integrate web_search and web_visit tools
|
| 92 |
+
|
| 93 |
Equip the served model with web_search and web_visit tools to enable internet-aware functionality. Alternatively, use a middleware like MCP for tool integration—see this example repository: https://github.com/hoanganhpham1006/mcp-server-template.
|
| 94 |
|
| 95 |
## Host on macOS with MLX for local use
|