> ## Documentation Index
> Fetch the complete documentation index at: https://docs.portkey.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# vLLM

> Integrate vLLM-hosted custom models with Portkey for production observability and reliability.

Portkey provides a robust platform to observe, govern, and manage your **locally** or **privately** hosted custom models using vLLM.

> [!NOTE]
>
> Here's a [list](https://docs.vllm.ai/en/latest/models/supported_models.html) of all model architectures supported on vLLM.

## Integration Steps

**1. Expose your vLLM Server**

Expose your vLLM server using a tunneling service like [ngrok](https://ngrok.com/) or make it publicly accessible. Skip this if you're self-hosting the Gateway.

```sh theme={"system"}
ngrok http 8000 --host-header="localhost:8080"
```

**2. Add to Model Catalog**

1. Go to [**Model Catalog → Add Provider**](https://app.portkey.ai/model-catalog/providers)
2. Enable **"Local/Privately hosted provider"** toggle
3. Select **OpenAI** as the provider type (vLLM follows OpenAI API schema)
4. Enter your vLLM server URL in **Custom Host**: `https://your-vllm-server.ngrok-free.app`
5. Add authentication headers if needed
6. Name your provider (e.g., `my-vllm`)

> [card] [Complete Setup Guide](https://docs.portkey.ai/docs/product/model-catalog.md)
>
> See all setup options

**3. Use in Your Application**

```python Python theme={"system"}
from portkey_ai import Portkey

portkey = Portkey(
    api_key="PORTKEY_API_KEY",
    provider="@my-vllm"
)

response = portkey.chat.completions.create(
    model="your-model-name",
    messages=[{"role": "user", "content": "Hello!"}]
)

print(response.choices[0].message.content)
```

```javascript Node.js theme={"system"}
import Portkey from 'portkey-ai';

const portkey = new Portkey({
    apiKey: 'PORTKEY_API_KEY',
    provider: '@my-vllm'
});

const response = await portkey.chat.completions.create({
    model: 'your-model-name',
    messages: [{ role: 'user', content: 'Hello!' }]
});

console.log(response.choices[0].message.content);
```

**Or use custom host directly:**

```python Python theme={"system"}
from portkey_ai import Portkey

portkey = Portkey(
    api_key="PORTKEY_API_KEY",
    provider="openai",
    custom_host="https://your-vllm-server.ngrok-free.app",
    Authorization="AUTH_KEY"  # If needed
)
```

```javascript Node.js theme={"system"}
import Portkey from 'portkey-ai';

const portkey = new Portkey({
    apiKey: 'PORTKEY_API_KEY',
    provider: 'openai',
    customHost: 'https://your-vllm-server.ngrok-free.app',
    Authorization: 'AUTH_KEY'  // If needed
});
```

> [!NOTE]
>
> **Important:** vLLM follows the OpenAI API specification, so set the provider as `openai` when using custom host directly. By default, vLLM runs on `http://localhost:8000/v1`.

***

## Next Steps

> [card] [Gateway Configs](https://docs.portkey.ai/docs/product/ai-gateway.md)
>
> Add retries, timeouts, and fallbacks

> [card] [Observability](https://docs.portkey.ai/docs/product/observability.md)
>
> Monitor your vLLM deployments

> [card] [Custom Host Guide](https://docs.portkey.ai/docs/product/ai-gateway/universal-api.md#integrating-local-or-private-models)
>
> Learn more about custom host setup

> [card] [BYOLLM Guide](https://docs.portkey.ai/docs/integrations/llms/byollm.md)
>
> Complete guide for private LLMs

For complete SDK documentation:

> [card] [SDK Reference](https://docs.portkey.ai/docs/api-reference/sdk/list.md)
>
> Complete Portkey SDK documentation

***

> [card] [Portkey is now PRISMA AIRS AI Gateway. See it in action.](https://www.paloaltonetworks.in/ai-security/ai-gateway?utm_source=portkey\&utm_medium=referral\&utm_campaign=prisma_airs\&utm_content=docs_nav#contact)
>
> Contact Us


## Related topics

- [4. Advanced Strategies for Performance Improvement](https://docs.portkey.ai/docs/guides/whitepapers/optimizing-llm-costs/advanced-strategies.md)
- [October](https://docs.portkey.ai/docs/changelog/2024/oct.md)
- [Supported Providers](https://docs.portkey.ai/docs/api-reference/inference-api/supported-providers.md)
- [April](https://docs.portkey.ai/docs/changelog/2025/apr.md)


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