Instructions to use cuijian0819/gpt-oss-20b-function-calling with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cuijian0819/gpt-oss-20b-function-calling with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cuijian0819/gpt-oss-20b-function-calling") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("cuijian0819/gpt-oss-20b-function-calling", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cuijian0819/gpt-oss-20b-function-calling with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cuijian0819/gpt-oss-20b-function-calling" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cuijian0819/gpt-oss-20b-function-calling", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/cuijian0819/gpt-oss-20b-function-calling
- SGLang
How to use cuijian0819/gpt-oss-20b-function-calling 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 "cuijian0819/gpt-oss-20b-function-calling" \ --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": "cuijian0819/gpt-oss-20b-function-calling", "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 "cuijian0819/gpt-oss-20b-function-calling" \ --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": "cuijian0819/gpt-oss-20b-function-calling", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use cuijian0819/gpt-oss-20b-function-calling with Docker Model Runner:
docker model run hf.co/cuijian0819/gpt-oss-20b-function-calling
GPT-OSS-20B Function Calling Model
This repository contains the GPT-OSS-20B model fine-tuned on function calling data in PyTorch/Safetensors format, ready for use with the Transformers library.
Model Details
- Base Model: openai/gpt-oss-20b
- Fine-tuning Dataset: Salesforce/xlam-function-calling-60k (2000 samples)
- Fine-tuning Method: LoRA (r=8, alpha=16)
- Context Length: 131,072 tokens
- Model Size: 20B parameters
Files
model.safetensors: Model weights in Safetensors formatconfig.json: Model configurationtokenizer.json,tokenizer_config.json: Tokenizer filesgeneration_config.json: Generation configuration
Usage
With Transformers Library
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load model and tokenizer
model = AutoModelForCausalLM.from_pretrained(
"cuijian0819/gpt-oss-20b-function-calling",
torch_dtype="auto",
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("cuijian0819/gpt-oss-20b-function-calling")
# Generate text
inputs = tokenizer("Your prompt here", return_tensors="pt")
outputs = model.generate(**inputs, max_length=100, temperature=0.7)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
Fine-tuning
This model can be further fine-tuned using standard PyTorch/Transformers workflows:
from transformers import AutoModelForCausalLM, AutoTokenizer, Trainer, TrainingArguments
model = AutoModelForCausalLM.from_pretrained("cuijian0819/gpt-oss-20b-function-calling")
tokenizer = AutoTokenizer.from_pretrained("cuijian0819/gpt-oss-20b-function-calling")
# Your fine-tuning code here
GGUF Version
For efficient inference with llama.cpp or Ollama, check out the GGUF version: cuijian0819/gpt-oss-20b-function-calling-gguf
Training Details
- Training Epochs: 5
- Learning Rate: 0.0002
- Batch Size: 4
- Gradient Accumulation: 4
- Max Length: 1024
License
This model inherits the license from the base openai/gpt-oss-20b model.
Citation
@misc{gpt-oss-20b-function-calling,
title={GPT-OSS-20B Function Calling Model},
author={cuijian0819},
year={2025},
url={https://huggingface.co/cuijian0819/gpt-oss-20b-function-calling}
}
Model tree for cuijian0819/gpt-oss-20b-function-calling
Base model
openai/gpt-oss-20b