> ## 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.

# LocalAI

> Integrate LocalAI-hosted models with Prisma AIRS AI Gateway for local LLM deployment with observability.

The AI Gateway provides a robust gateway to facilitate the integration of your **locally hosted models through** [**LocalAI**](https://localai.io/).

## Integration Steps

**1. Expose your LocalAI Server**

Ensure your LocalAI API is externally accessible. If running on `http://localhost`, use a tool like `ngrok` to create a public URL.

```sh theme={"system"}
ngrok http 8080
```

**2. Add to Model Catalog**

1. Go to [**Model Catalog → Add Provider**](https://stratacloudmanager.paloaltonetworks.com/)
2. Enable **"Local/Privately hosted provider"** toggle
3. Select **OpenAI** as the provider type (LocalAI follows OpenAI API schema)
4. Enter your LocalAI URL with `/v1` in **Custom Host**: `https://your-localai.ngrok-free.app/v1`
5. Name your provider (e.g., `my-localai`)

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

**3. Use in Your Application**

**Or use custom host directly:**

> [!NOTE]
>
> **Important:**
>
> * Don't forget to include the version identifier (`/v1`) in the Custom Host URL
> * The AI Gateway supports all endpoints that adhere to the OpenAI specification

***

## LocalAI Endpoints Supported

| Endpoint | Resource |
| :- | :- |
| /chat/completions (Chat, Vision, Tools support) | [Doc](https://docs.portkey.ai/docs/aigw/api-reference/chat/create-chat-completion.md) |
| /images/generations | [Doc](https://docs.portkey.ai/docs/aigw/api-reference/images/create-image.md) |
| /embeddings | [Doc](https://docs.portkey.ai/docs/aigw/api-reference/embeddings/create-embedding.md) |
| /audio/transcriptions | [Doc](https://docs.portkey.ai/docs/aigw/product/ai-gateway/multimodal-capabilities/speech-to-text.md) |

***

## Next Steps

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

> **[Observability](https://docs.portkey.ai/docs/aigw/product/observability.md)**
>
> Monitor your LocalAI requests

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

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


## Related topics

- [Overview](https://docs.portkey.ai/docs/aigw/integrations/llms.md)
- [Custom hosts](https://docs.portkey.ai/docs/aigw/product/ai-gateway/custom-hosts.md)
- [Anthropic Computer Use](https://docs.portkey.ai/docs/aigw/integrations/libraries/anthropic-computer-use.md)
- [Deepgram](https://docs.portkey.ai/docs/aigw/integrations/llms/deepgram.md)
- [Universal API](https://docs.portkey.ai/docs/aigw/product/ai-gateway/universal-api.md)


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