GPT-OSS 20B
Invoke GPT-OSS 20B, a 20B-parameter large language model with a 131k-token context length, and send it a tool-calling request.
GPT-OSS 20B is an open-source large language model with 20 billion parameters, built for text generation, conversation, and other natural language processing tasks. It reads text, returns text, and accepts tool definitions in the request. AI Inference runs it under the id gpt-oss-20b.
Model details
The model id is the string that selects this model, and it is the first argument Azion.AI.run takes. The HuggingFace repository holds the model card.
| Detail | Value |
|---|---|
| Model name | GPT-OSS 20B |
| Version | 20B |
| Model category | Large Language Model (LLM) |
| Model id | gpt-oss-20b |
| Size | 20B parameters |
| HuggingFace model | openai/gpt-oss-20b |
| OpenAI-compatible endpoint | OpenAI Chat API |
| License | Apache 2.0 |
Capabilities
These values belong to the model and are not part of the request body. For the fields every chat request accepts, with their types, defaults, and bounds, refer to Model invocation.
| Capability | Value |
|---|---|
| Input data | Text |
| Context length | 131k tokens |
| Tool calling | Yes |
| Supports LoRA | No |
Usage
A function invokes the model with Azion.AI.run, passing the id as the first argument and an OpenAI-compatible request body as the second. The examples below use that binding. To send the same body to the OpenAI-compatible HTTP endpoint instead, refer to Model invocation.
Chat completion
This request carries a system message, a user message, and the sampling fields that shape the output:
The model answers with one entry in choices, and the generated text sits at choices[0].message.content:
Tool calling
A tool-calling request adds a tools array to the body. Each entry sets type to function and carries a function object holding the name the model calls, a description of what it does, and its parameters in JSON Schema form:
When the model selects a tool, it returns content as null, names the call in tool_calls with the arguments it chose, and sets finish_reason to tool_calls: