Text Generation
Transformers
Safetensors
English
qwen3
biomedicine
function-calling
tool-use
biotool
ncbi
uniprot
ensembl
llama-factory
conversational
text-generation-inference
Instructions to use gxx27/BioTool-finetuned-Qwen3-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gxx27/BioTool-finetuned-Qwen3-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="gxx27/BioTool-finetuned-Qwen3-4B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("gxx27/BioTool-finetuned-Qwen3-4B") model = AutoModelForCausalLM.from_pretrained("gxx27/BioTool-finetuned-Qwen3-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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use gxx27/BioTool-finetuned-Qwen3-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "gxx27/BioTool-finetuned-Qwen3-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": "gxx27/BioTool-finetuned-Qwen3-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/gxx27/BioTool-finetuned-Qwen3-4B
- SGLang
How to use gxx27/BioTool-finetuned-Qwen3-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 "gxx27/BioTool-finetuned-Qwen3-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": "gxx27/BioTool-finetuned-Qwen3-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 "gxx27/BioTool-finetuned-Qwen3-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": "gxx27/BioTool-finetuned-Qwen3-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use gxx27/BioTool-finetuned-Qwen3-4B with Docker Model Runner:
docker model run hf.co/gxx27/BioTool-finetuned-Qwen3-4B
Update README.md
Browse files
README.md
CHANGED
|
@@ -20,16 +20,11 @@ pipeline_tag: text-generation
|
|
| 20 |
|
| 21 |
# BioTool-finetuned-Qwen3-4B
|
| 22 |
|
| 23 |
-
Qwen3-4B-Instruct-2507 fully fine-tuned on the **[BioTool](https://github.com/
|
| 24 |
training split (5,632 samples). The resulting model produces structured tool calls
|
| 25 |
against **127 biomedical APIs** spanning NCBI E-utilities + BLAST, UniProt and
|
| 26 |
Ensembl REST.
|
| 27 |
|
| 28 |
-
This is the headline checkpoint released with:
|
| 29 |
-
|
| 30 |
-
> Gao et al., **"BioTool: A Comprehensive Tool-Calling Dataset for Enhancing
|
| 31 |
-
> Biomedical Capabilities of Large Language Models"**, arXiv:2605.05758, 2026.
|
| 32 |
-
|
| 33 |
## Quick start
|
| 34 |
|
| 35 |
```python
|
|
@@ -62,20 +57,14 @@ print(tok.decode(out[0][tok(prompt, return_tensors="pt")["input_ids"].shape[1]:]
|
|
| 62 |
skip_special_tokens=False))
|
| 63 |
```
|
| 64 |
|
| 65 |
-
The model emits tool calls in the form
|
| 66 |
-
|
| 67 |
-
```
|
| 68 |
-
<tool_call>
|
| 69 |
-
{"name": "lookup_by_symbol", "arguments": {"species": "human", "symbol": "BRCA1"}}
|
| 70 |
-
</tool_call>
|
| 71 |
-
```
|
| 72 |
-
|
| 73 |
To **execute** the resulting tool call, use the Python wrappers in the
|
| 74 |
-
[
|
| 75 |
|
| 76 |
```python
|
| 77 |
-
import sys
|
|
|
|
| 78 |
from ensembl.lookup.api import lookup_by_symbol
|
|
|
|
| 79 |
print(lookup_by_symbol(species="human", symbol="BRCA1"))
|
| 80 |
```
|
| 81 |
|
|
@@ -100,7 +89,7 @@ print(lookup_by_symbol(species="human", symbol="BRCA1"))
|
|
| 100 |
- **Epochs:** 3
|
| 101 |
- **Effective batch size:** 16 (per-device 1 × grad-accum 16)
|
| 102 |
- **Precision:** bf16
|
| 103 |
-
- **Hyperparameter file:** `qwen3_4b.yaml` in the
|
| 104 |
`llamafactory_cfgs/`
|
| 105 |
|
| 106 |

|
|
@@ -110,7 +99,7 @@ print(lookup_by_symbol(species="human", symbol="BRCA1"))
|
|
| 110 |
On the BioTool test split (1,408 samples), this model achieves the highest
|
| 111 |
**BioTool Score** among the open-source models we evaluated, while also being
|
| 112 |
the smallest (4B parameters). Per-database breakdowns and head-to-head numbers
|
| 113 |
-
against GPT-5.1, GPT-5.1-Codex, Claude Sonnet 4.5 and Gemini 3
|
| 114 |
reported in the paper.
|
| 115 |
|
| 116 |
## Citation
|
|
|
|
| 20 |
|
| 21 |
# BioTool-finetuned-Qwen3-4B
|
| 22 |
|
| 23 |
+
Qwen3-4B-Instruct-2507 fully fine-tuned on the **[BioTool](https://github.com/gxx27/BioTool)**
|
| 24 |
training split (5,632 samples). The resulting model produces structured tool calls
|
| 25 |
against **127 biomedical APIs** spanning NCBI E-utilities + BLAST, UniProt and
|
| 26 |
Ensembl REST.
|
| 27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
## Quick start
|
| 29 |
|
| 30 |
```python
|
|
|
|
| 57 |
skip_special_tokens=False))
|
| 58 |
```
|
| 59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
To **execute** the resulting tool call, use the Python wrappers in the
|
| 61 |
+
[BioTool repository](https://github.com/gxx27/BioTool):
|
| 62 |
|
| 63 |
```python
|
| 64 |
+
import sys
|
| 65 |
+
sys.path.insert(0, "/path/to/BioTool")
|
| 66 |
from ensembl.lookup.api import lookup_by_symbol
|
| 67 |
+
|
| 68 |
print(lookup_by_symbol(species="human", symbol="BRCA1"))
|
| 69 |
```
|
| 70 |
|
|
|
|
| 89 |
- **Epochs:** 3
|
| 90 |
- **Effective batch size:** 16 (per-device 1 × grad-accum 16)
|
| 91 |
- **Precision:** bf16
|
| 92 |
+
- **Hyperparameter file:** `qwen3_4b.yaml` in the BioTool repo's
|
| 93 |
`llamafactory_cfgs/`
|
| 94 |
|
| 95 |

|
|
|
|
| 99 |
On the BioTool test split (1,408 samples), this model achieves the highest
|
| 100 |
**BioTool Score** among the open-source models we evaluated, while also being
|
| 101 |
the smallest (4B parameters). Per-database breakdowns and head-to-head numbers
|
| 102 |
+
against GPT-5.1, GPT-5.1-Codex, Claude Sonnet 4.5 and Gemini 3 Pro are
|
| 103 |
reported in the paper.
|
| 104 |
|
| 105 |
## Citation
|