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

# Streaming Agent

## Code

```python cookbook/11_models/lmstudio/basic_stream.py theme={null}
from typing import Iterator  # noqa
from agno.agent import Agent, RunOutput  # noqa
from agno.models.lmstudio import LMStudio

agent = Agent(model=LMStudio(id="qwen2.5-7b-instruct-1m"), markdown=True)

# Get the response in a variable
# run_response: Iterator[RunOutputEvent] = agent.run("Share a 2 sentence horror story", stream=True)
# for chunk in run_response:
#     print(chunk.content)

# Print the response in the terminal
agent.print_response("Share a 2 sentence horror story", stream=True)
```

## Usage

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

  <Step title="Install LM Studio">
    Install LM Studio from [here](https://lmstudio.ai/download) and download the
    model you want to use.
  </Step>

  <Step title="Install dependencies">`bash uv pip install -U agno `</Step>

  <Step title="Run Agent">
    ```bash theme={null}
    python cookbook/11_models/lmstudio/basic_stream.py
    ```
  </Step>
</Steps>
