Self-Hosting
Partite Mesh is open source: partite-ai/mesh. You can run all of it on your own servers: agents, models, tools, memory, conversations, workspaces, traces, access points and boundaries. It runs the same meshes as the hosted service, and serves the same APIs.
You can configure it in two ways:
- Cloud config. Build meshes in the hosted UI and run them on your own servers. Partite Mesh reads its configuration and credentials from the hosted service. Conversations, memory, workspaces and traces stay on your servers.
- Local config. Everything stays on your servers, and nothing connects to the hosted service. There is no UI. Configure meshes with Terraform, the CLI or the GraphQL API.
Start the server
Install Partite Mesh with Homebrew, build it from source, or run it in Docker.
With Homebrew, on macOS or Linux:
brew install partite-ai/tap/partite-meshFrom source, you need Go 1.27 or later. Get the code, and run go run ./cmd/server wherever this page says partite-mesh:
git clone https://github.com/partite-ai/mesh.git
cd meshWith cloud config
- In the hosted UI, open Access > API keys and create a key with the scopes Read configuration and Use credentials. To see your traces in the hosted trace viewer, also add Trace meshes.
- Start the server with the key’s token:
CLOUD_API_TOKEN=<API key token> partite-meshThe server asks the hosted service for configuration when it needs it, and keeps it for 30 seconds (CLOUD_CONFIG_CACHE_TTL). A change you make in the UI reaches the server within about that long. The server also keeps the last configuration on disk. If it can’t reach the hosted service, it keeps running with that. Credentials are never kept on disk.
Mesh IDs are the same as in the hosted service. API keys are the hosted service’s keys.
With local config
CONFIGURATION_MODE=local partite-meshConfigure it with one of these:
- Terraform: set the provider’s
endpointtohttp://localhost:8080/graphql. - The CLI: use the
localcontext. - The GraphQL API at
http://localhost:8080/graphql. A GraphQL playground is athttp://localhost:8080/playground.
The server seals stored credentials, such as model provider keys, with a key it keeps in the operating system’s keychain. Where there is no keychain, as in a container, set CREDENTIAL_KEY_PROVIDER=none to store credentials unsealed.
In Docker
Build the image from the repository, and keep its data in a volume:
docker build -t partite-mesh .
docker run -p 8080:8080 -v partite-data:/var/lib/partite \
-e CLOUD_API_TOKEN=<API key token> partite-meshFor local config, pass -e CONFIGURATION_MODE=local instead of the token. The image already sets CREDENTIAL_KEY_PROVIDER=none.
Call the server
The server listens on port 8080 (SERVER_PORT). Call it with the same APIs as the hosted service, at http://localhost:8080 instead of https://api.partite.ai: the Conversation API, AG-UI, MCP and webhooks.
Secure the server
By default the server doesn’t check API keys. While it doesn’t, it only takes requests from pages on loopback origins and to localhost or an IP address. That keeps a web page you visit from driving the server. To allow other origins and host names, set CORS_ALLOWED_ORIGINS and ALLOWED_HOSTS.
Before you make the server reachable from other machines, set REQUIRE_AUTH=true. Callers must then send an API key, or a token from an access point.
- With cloud config, use keys you create in the hosted UI.
- With local config, create keys before you turn on
REQUIRE_AUTH, for example withpartite api-key createor the GraphQL API. Then restart the server withREQUIRE_AUTH=true.
Set PUBLIC_BASE_URL to the URL callers reach the server at, such as https://mesh.example.com. Access point URLs start with it.
Traces
The server keeps traces in its own database. With local config, there is no trace viewer.
With cloud config, the server can upload traces to the hosted service, where the trace viewer shows them. The API key needs the Trace meshes scope. Set CLOUD_TRACE_UPLOAD:
| Value | What happens |
|---|---|
disabled | Traces stay on your server. This is the default. |
automatic | Each trace is uploaded as it is recorded. |
manual | Traces are uploaded when you ask with POST /traces/upload. |
To ask for an upload, send POST /traces/upload to the server. The body {"conversation_ids": ["<CONVERSATION_ID>"]} uploads the traces of those conversations. An empty body uploads every trace. The response has queued_rows, and untraced_conversations: the conversations you named that have no trace.
A self-hosted Partite Mesh records tokens, but not cost. See Traces.
Data
The server keeps its data in SQLite databases in ~/.partite, or /var/lib/partite in the Docker image. Back up that folder.
Conversations and traces are kept forever unless you set CONVERSATION_RETENTION and TRACE_RETENTION, such as 720h for 30 days. The time counts from when anything was last added to the conversation or trace.
Workspaces keep files only when you set FILESTORE_ROOT_DIR to a folder. Without it, workspaces have key/value state but no files.
What the hosted service adds
These need the hosted service, and don’t work when you host Partite Mesh yourself:
- The UI, to build, test and debug meshes. With cloud config, you build in the UI, but the UI’s Converse page runs meshes on the hosted service, not on your server.
- Evaluations: evaluators, rubrics and monitors.
- Schedules.
- The cost of model calls in traces.
- Organizations, members and sign-in.
Settings
The server reads its settings from environment variables. The full list is in environment_variables.md. The ones you are most likely to set:
| Variable | What it does | Default |
|---|---|---|
CONFIGURATION_MODE | cloud or local | cloud |
CLOUD_API_TOKEN | The API key token, for cloud config | (none) |
CLOUD_TRACE_UPLOAD | automatic, manual or disabled | disabled |
SERVER_PORT | The port the server listens on | 8080 |
PUBLIC_BASE_URL | The URL callers reach the server at | taken from each request |
REQUIRE_AUTH | Whether callers must send an API key or access point token | false |
CREDENTIAL_KEY_PROVIDER | keychain or none, for local config | keychain |
FILESTORE_ROOT_DIR | Where workspace files are kept | (none) |
WORKSPACE_DOWNLOAD_LINK_TTL | How long a link to read or write a workspace file works | 2m |
PARTICLE_MEMORY_LIMIT_MB | The most memory one particle may use, in MB | 16 |
PARTICLE_TOOL_CALL_TIMEOUT | How long one particle tool call may run its own code. Waiting in HTTP and key/value calls doesn’t count. | 3s |
WEBHOOK_HANDLER_CALL_TIMEOUT | How long one webhook handler call may take | 1s |
CONVERSATION_RETENTION, TRACE_RETENTION | How long conversations and traces are kept | forever |
Related
- API Keys: the scopes for cloud config.
- Configuration As Code: configure meshes with Terraform.
- CLI: the
localcontext. - MCP Tunnel and Resources: reach MCP servers in private networks.