Documentation
Documentation
Everything you need to get started with GPT-OSS
Comprehensive guides, API references, and tutorials to help you deploy and use GPT-OSS models effectively.
Quick Start
Get up and running with GPT-OSS in minutes
1
Install Dependencies
Set up your environment with the required packages
pip install transformers torch accelerate2
Load the Model
Initialize GPT-OSS model in your application
from transformers import AutoModelForCausalLM, AutoTokenizer3
Generate Text
Start generating text with your model
output = model.generate(input_ids, max_length=100)Installation Guide
Multiple ways to install and deploy GPT-OSS models
Ollama
Simplest way to run GPT-OSS locally
- Install Ollama from ollama.ai
- Run: ollama pull gpt-oss:120b
- Start chatting: ollama run gpt-oss:120b
Hugging Face
Use with transformers library
- pip install transformers torch
- Load model: AutoModelForCausalLM.from_pretrained('openai/gpt-oss-120b')
- Generate text with the model
VLLM
High-performance inference server
- pip install vllm
- vllm serve openai/gpt-oss-120b
- Use OpenAI-compatible API
Docker
Containerized deployment
- docker pull gpt-oss:120b
- docker run -p 8000:8000 gpt-oss:120b
- Access via HTTP API
API Reference
Complete API documentation for GPT-OSS models
POST
/v1/chat/completionsCreate a chat completion
Parameters:
messagesarray
Required
List of messages in the conversationmodelstring
Required
Model to use for completionmax_tokensinteger
Maximum number of tokens to generatetemperaturenumber
Sampling temperature (0-2)POST
/v1/completionsCreate a text completion
Parameters:
promptstring
Required
Text prompt to completemodelstring
Required
Model to use for completionmax_tokensinteger
Maximum number of tokens to generateReady to Build?
Start building amazing applications with GPT-OSS models today.
