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

> ## Agent Instructions
> These are the docs for Sevalla, a platform for deploying applications, databases, static sites, object storage and load balancers. The dashboard is at https://app.sevalla.com.
> Bold text in steps is an exact dashboard label.
> To act on a Sevalla account, prefer the Sevalla MCP server (https://mcp.sevalla.com/mcp, see https://docs.sevalla.com/ai-agents/overview.md), then the Sevalla CLI (https://docs.sevalla.com/developer-tools/cli.md), then the REST API (https://api-docs.sevalla.com, OpenAPI spec at https://api.sevalla.com/v3/openapi.json).
> Every page index is at https://docs.sevalla.com/llms.txt.

# Deploy AI applications

> Run MCP servers, AI agents, agent swarms, chatbots, RAG and self-hosted AI tools on Sevalla: how streaming, long tasks, private services and state work, and how to keep them secure.

An AI application runs on Sevalla like any other [application](https://docs.sevalla.com/applications/overview.md): a web process serves its API, chat interface or MCP endpoint, background workers run long agent tasks, and databases keep conversations, queues and embeddings. The models run at providers such as Anthropic and OpenAI, called over HTTPS with API keys in [environment variables](https://docs.sevalla.com/applications/environment-variables.md), or on CPU inside Sevalla with [Ollama](https://docs.sevalla.com/guides/ai/ollama.md).

![An AI application runs as one image with two processes: a web process for the API or chat UI, on port 8080 behind Cloudflare's edge and Sevalla's edge worker, and a background worker for long agent tasks. The web process adds tasks to a Redis or Valkey queue and the worker takes them, both keep embeddings and agent memory in PostgreSQL with pgvector, over internal connections that stay inside the data center. Files go to Sevalla object storage over HTTPS, and model providers such as Anthropic and OpenAI, outside Sevalla, are called over HTTPS with API keys kept in environment variables.](https://assets.sevalla.com/brand/diagrams/docs/ai-app-architecture-light.svg)

Every guide in this section was followed on Sevalla from an empty folder. Guides for code you write build with [Ingot](https://docs.sevalla.com/applications/builds/ingot.md) and with a Dockerfile; guides for packaged tools deploy the vendor's official [Docker image](https://docs.sevalla.com/applications/docker-images.md). Each one ends with the same deployment as [API](https://docs.sevalla.com/developer-tools/api.md) calls, so an AI agent can run it.

## MCP servers

> **[MCP server with TypeScript](https://docs.sevalla.com/guides/ai/mcp-typescript.md)**
>
> A remote MCP server on Streamable HTTP with the official TypeScript SDK, bearer token auth and PostgreSQL tools.

> **[MCP server with Python](https://docs.sevalla.com/guides/ai/mcp-python.md)**
>
> The same server with the official Python SDK and uv, stateless so it runs on several instances.

## Agents

> **[Claude Agent SDK](https://docs.sevalla.com/guides/ai/claude-agent-sdk.md)**
>
> An agent with custom tools behind an HTTP API, a background worker and sessions in PostgreSQL.

> **[OpenAI Agents SDK](https://docs.sevalla.com/guides/ai/openai-agents-sdk.md)**
>
> Agents with tools and a handoff, streamed by FastAPI, with sessions in PostgreSQL.

> **[LangGraph](https://docs.sevalla.com/guides/ai/langgraph.md)**
>
> A tool-calling graph with the PostgreSQL checkpointer and a human approval step.

> **[Mastra](https://docs.sevalla.com/guides/ai/mastra.md)**
>
> A TypeScript agent with a tool, a workflow and memory in PostgreSQL.

> **[Claude Code](https://docs.sevalla.com/guides/ai/claude-code.md)**
>
> A Claude Code session in the cloud that you open from the web terminal and that keeps working when you leave.

> **[Agent swarm](https://docs.sevalla.com/guides/ai/agent-swarm.md)**
>
> A builder and a reviewer agent that work through GitHub pull requests, and a queue between them.

## Chat and retrieval

> **[AI chatbot](https://docs.sevalla.com/guides/ai/ai-sdk-chatbot.md)**
>
> A Next.js chatbot with the AI SDK that streams answers and saves chats in PostgreSQL.

> **[RAG with pgvector](https://docs.sevalla.com/guides/ai/rag-pgvector.md)**
>
> Embeddings in PostgreSQL with an HNSW index, and answers that cite their sources.

> **[Qdrant](https://docs.sevalla.com/guides/ai/qdrant.md)**
>
> A private vector database on a disk, with snapshots in object storage.

## Models and tools you host

> **[Ollama](https://docs.sevalla.com/guides/ai/ollama.md)**
>
> Open models on CPU in a private application, with measured speeds per size.

> **[LiteLLM](https://docs.sevalla.com/guides/ai/litellm.md)**
>
> One OpenAI-compatible endpoint for every model, with a key and budget per application.

> **[OpenRouter](https://docs.sevalla.com/guides/ai/openrouter.md)**
>
> Models from many providers through one API, with fallbacks and cost per key.

> **[Open WebUI](https://docs.sevalla.com/guides/ai/open-webui.md)**
>
> A private chat interface for your team, connected to LiteLLM and Ollama.

> **[n8n](https://docs.sevalla.com/guides/ai/n8n.md)**
>
> Workflow automation with AI agent nodes, scaled with queue mode and workers.

> **[Langflow](https://docs.sevalla.com/guides/ai/langflow.md)**
>
> Visual AI flows that you run through Langflow's API.

> **[Langfuse](https://docs.sevalla.com/guides/ai/langfuse.md)**
>
> Tracing, cost and evaluation for your model calls, self-hosted.

## How AI applications run on Sevalla

| Topic | On Sevalla |
| - | - |
| Model API keys | Store them as environment variables available during runtime only, so they never reach the build or the image. |
| Streaming | Server-Sent Events, chunked responses and WebSockets reach the client unbuffered through Cloudflare and Sevalla's proxy, with no extra headers. |
| Long agent runs | A request that sends nothing for too long gets Cloudflare's `524` (see [HTTP errors](https://docs.sevalla.com/applications/troubleshooting/http-errors.md#504-gateway-timeout-and-cloudflare-error-524)). Stream progress so bytes keep flowing, or run the task in a [background worker](https://docs.sevalla.com/applications/processes.md#background-workers) and let the client poll for the result. |
| Several instances | Sevalla sends each request to any instance, with no session affinity. Keep conversations, sessions and queues in PostgreSQL, Redis or Valkey, and run MCP servers in stateless mode. |
| Private services | Turn [HTTP traffic off](https://docs.sevalla.com/applications/networking.md#turn-http-traffic-off) for model servers, proxies and agents nobody should reach from the internet, and call them over [internal connections](https://docs.sevalla.com/applications/networking.md#internal-connections). |
| Vectors | PostgreSQL databases created with **Enable pgvector extension** store embeddings; the extension can't be turned on later. See [RAG with pgvector](https://docs.sevalla.com/guides/ai/rag-pgvector.md). |
| Files and models | A [disk](https://docs.sevalla.com/applications/disks.md) keeps files across deployments, for one instance. Object storage holds files that every instance reads. |
| Workers | Start a worker's command with `exec`, so it gets `SIGTERM` and finishes its task when an instance stops. See [How processes run](https://docs.sevalla.com/applications/processes.md#how-processes-run). |
| Hardware | CPU only: no process size has a GPU. Small open models run on Ollama; larger ones belong at a model provider. See [Limits](https://docs.sevalla.com/platform/limits.md). |
| Interactive agents | The [web terminal](https://docs.sevalla.com/applications/web-terminal.md) opens a shell in a running instance, and a tmux session keeps an agent working when you close the tab. See [Claude Code](https://docs.sevalla.com/guides/ai/claude-code.md). |

## Keep AI applications secure

* **Authenticate every public endpoint** that can spend money or call tools, at least with a bearer token in an environment variable.
* **Never expose an agent with shell or write tools** to the internet. Turn its HTTP traffic off and reach it through the web terminal or an internal connection.
* **Treat what an agent reads as untrusted.** Pull requests, web pages, tickets and tool results can carry prompt injection, so let your code, not the model, take irreversible actions such as merging, paying or deleting.
* **Give agents least-privilege tokens**, such as a fine-grained GitHub token for one repository, and set spending limits on your model provider accounts.

To let an AI agent deploy and manage these applications for you, connect it to the [Sevalla MCP server](https://docs.sevalla.com/ai-agents/overview.md).


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