> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# GPT-OSS Essay Writer

> Write a 300-word essay on a user-provided topic with GPT-OSS 120B through Hugging Face.

## Code

```python llama_essay_writer.py theme={null}
from agno.agent import Agent
from agno.models.huggingface import HuggingFace

agent = Agent(
    model=HuggingFace(
        id="openai/gpt-oss-120b",
        max_tokens=4096,
    ),
    description="You are an essay writer. Write a 300 words essay on topic that will be provided by user",
)
agent.print_response("topic: AI")
```

## Usage

<Snippet file="create-venv-step.mdx" />

**1. Set your API key**

```bash theme={null}
export HF_TOKEN=xxx
```

**2. Install dependencies**

```bash theme={null}
uv pip install -U huggingface_hub agno
```

**3. Run Agent**

Save the code above as `llama_essay_writer.py`, then run:

```bash theme={null}
python llama_essay_writer.py
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.