Instructions to use yasutoshi-lab/gpt-oss-20b-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yasutoshi-lab/gpt-oss-20b-gguf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="yasutoshi-lab/gpt-oss-20b-gguf") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("yasutoshi-lab/gpt-oss-20b-gguf", dtype="auto") - llama-cpp-python
How to use yasutoshi-lab/gpt-oss-20b-gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="yasutoshi-lab/gpt-oss-20b-gguf", filename="gpt-oss-20b.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use yasutoshi-lab/gpt-oss-20b-gguf with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf yasutoshi-lab/gpt-oss-20b-gguf # Run inference directly in the terminal: llama-cli -hf yasutoshi-lab/gpt-oss-20b-gguf
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf yasutoshi-lab/gpt-oss-20b-gguf # Run inference directly in the terminal: llama-cli -hf yasutoshi-lab/gpt-oss-20b-gguf
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf yasutoshi-lab/gpt-oss-20b-gguf # Run inference directly in the terminal: ./llama-cli -hf yasutoshi-lab/gpt-oss-20b-gguf
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf yasutoshi-lab/gpt-oss-20b-gguf # Run inference directly in the terminal: ./build/bin/llama-cli -hf yasutoshi-lab/gpt-oss-20b-gguf
Use Docker
docker model run hf.co/yasutoshi-lab/gpt-oss-20b-gguf
- LM Studio
- Jan
- vLLM
How to use yasutoshi-lab/gpt-oss-20b-gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yasutoshi-lab/gpt-oss-20b-gguf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yasutoshi-lab/gpt-oss-20b-gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/yasutoshi-lab/gpt-oss-20b-gguf
- SGLang
How to use yasutoshi-lab/gpt-oss-20b-gguf 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 "yasutoshi-lab/gpt-oss-20b-gguf" \ --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": "yasutoshi-lab/gpt-oss-20b-gguf", "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 "yasutoshi-lab/gpt-oss-20b-gguf" \ --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": "yasutoshi-lab/gpt-oss-20b-gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use yasutoshi-lab/gpt-oss-20b-gguf with Ollama:
ollama run hf.co/yasutoshi-lab/gpt-oss-20b-gguf
- Unsloth Studio
How to use yasutoshi-lab/gpt-oss-20b-gguf with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for yasutoshi-lab/gpt-oss-20b-gguf to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for yasutoshi-lab/gpt-oss-20b-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for yasutoshi-lab/gpt-oss-20b-gguf to start chatting
- Pi
How to use yasutoshi-lab/gpt-oss-20b-gguf with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf yasutoshi-lab/gpt-oss-20b-gguf
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "yasutoshi-lab/gpt-oss-20b-gguf" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use yasutoshi-lab/gpt-oss-20b-gguf with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf yasutoshi-lab/gpt-oss-20b-gguf
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:8080/v1 hermes config set model.default yasutoshi-lab/gpt-oss-20b-gguf
Run Hermes
hermes
- Atomic Chat new
- Docker Model Runner
How to use yasutoshi-lab/gpt-oss-20b-gguf with Docker Model Runner:
docker model run hf.co/yasutoshi-lab/gpt-oss-20b-gguf
- Lemonade
How to use yasutoshi-lab/gpt-oss-20b-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull yasutoshi-lab/gpt-oss-20b-gguf
Run and chat with the model
lemonade run user.gpt-oss-20b-gguf-{{QUANT_TAG}}List all available models
lemonade list
モデル情報
- このモデルはopenai/gpt-oss-20bをllama.cppでGGUF化したものです。
- 同じディレクトリに含まれる各種Modefileを利用して、ローカルのOllamaで利用することができます。
- Modefleのシステムプロンプトや各種パラメーターを変更することで、高度な調整を反映できます。
オプション:簡単な調整方法
- 高度な調整は不要だが、パラメーターの調整を実施したい場合は次のような流れで簡単に調整することができます。
# 通常のopenai/gpt-oss-20bをダウンロードして実行
ollama run gpt-oss:20b
# 例)コンテキスト長を64000に設定
/set parameter num_ctx 64000
# モデルを新しい名前で保存
/save gpt-oss:20b-64k
# Ollamaを終了
/bye
# 保存したモデルで実行
ollama run gpt-oss:20b-64k
パラメーターの設定例
/set parameter num_ctx 64000 # コンテキスト長を64000に設定
/set parameter temperature 0.5 # 温度を0.5に設定
/set parameter top_p 0.9 # top_pを0.9に設定
/set parameter top_k 40 # top_kを40に設定
/set parameter num_predict 4096 # 最大生成トークン数を4096に設定
使い方
ファイルのダウンロード
from huggingface_hub import snapshot_download
snapshot_download(repo_id="yasutoshi-lab/gpt-oss-20b-gguf", local_dir="./model")
ビルド
# コンテキスト長:120k, 温度:1, デフォルト推論モード:lowを作成する場合
ollama create gpt-oss-20b:120k-low-thinking -f ./model/gpt-oss-20b-120k-low-thinking.Modefile
# コンテキスト長:120k, 温度:1, デフォルト推論モード:mediumを作成する場合
ollama create gpt-oss-20b:120k-medium-thinking -f ./model/gpt-oss-20b-120k-medium-thinking.Modefile
# コンテキスト長:120k, 温度:1, デフォルト推論モード:highを作成する場合
ollama create gpt-oss-20b:120k-high-thinking -f ./model/gpt-oss-20b-120k-high-thinking.Modefile
推論実行
# コンテキスト長:120k, 温度:1, デフォルト推論モード:lowを実行する場合
ollama run gpt-oss-20b:120k-low-thinking
# コンテキスト長:120k, 温度:1, デフォルト推論モード:mediumを実行する場合
ollama run gpt-oss-20b:120k-medium-thinking
# コンテキスト長:120k, 温度:1, デフォルト推論モード:highを実行する場合
ollama run gpt-oss-20b:120k-high-thinking
トラブルシューティング
エラー
- "toTypeScriptType"が発生
# ビルドコマンドの実行
ubuntu@ubuntu:~$ ollama create gpt-oss-20b:120k-low-thinking -f ./model/gpt-oss-20b-120k-low-thinking.Modefil
# ターミナルの出力
gathering model components
copying file sha256:7580f705e503c7a5a8a4cedc1d2bed8a3a1a4d5303190c63c7630f722f8c646f 100%
parsing GGUF
Error: template error: template: :109: function "toTypeScriptType" not defined
解決方法
- 古いバージョンでは対応していないため、Ollamaのバージョンを最新にする
- Downloads last month
- 13
Hardware compatibility
Log In to add your hardware
We're not able to determine the quantization variants.
Model tree for yasutoshi-lab/gpt-oss-20b-gguf
Base model
openai/gpt-oss-20bCollection including yasutoshi-lab/gpt-oss-20b-gguf
Collection
openai/gpt-oss-20b, converted from MXFP4 to BF16 • 3 items • Updated