Configuration for private deployments
A private deployment reads its settings from environment variables in deploy/private.env. configure.py creates that file from the bundle's example with fresh random secrets. You then fill in your own endpoints and sign-in. On the cloud service none of this applies. We run that configuration.
Never put a secret's value anywhere but the server's environment. Settings in the app take only credential references.
Mode and addresses
| Variable | Value |
|---|---|
YI_MODE | production |
YI_DEPLOYMENT | private |
YI_OFFLINE | true for a deployment with no internet access. Requires YI_DEPLOYMENT=private |
YI_PUBLIC_URL | The HTTPS address people open, for example https://agent.corp.internal. Production requires HTTPS |
YI_ALLOWED_HOSTS | Host names the API answers to, comma-separated |
YI_DATABASE_URL | The PostgreSQL connection URL. Production requires PostgreSQL. configure.py fills in the bundled database's password |
POSTGRES_DB, POSTGRES_USER, POSTGRES_PASSWORD | The bundled database. The password is generated |
YI_SESSION_SECRET, YI_TOKEN_SECRET | Two different random values of at least 32 characters. Generated by configure.py. Don't reuse them elsewhere |
Sign-in
Register a client for Yi Code at your identity provider with the redirect URI YI_PUBLIC_URL followed by /auth/callback, for example https://agent.corp.internal/auth/callback.
| Variable | Value |
|---|---|
YI_OIDC_ISSUER | The provider's issuer URL. Required in production |
YI_OIDC_CLIENT_ID | The client ID. Default yi-agent |
YI_OIDC_CLIENT_SECRET | The client secret, if the client is confidential |
YI_PRIVATE_ORG_ID | The organization everyone in this deployment belongs to, for example customer |
YI_OIDC_ROLE_CLAIM | The claim that carries the role. Default org_role. Values are owner, admin or member. Anything else counts as member |
YI_OIDC_ORG_ROLE | Optional. Gives every user the same role, for a single-team provider. Prefer a signed role claim, and never give every internal user admin |
YI_OIDC_ORG_CLAIM | In the example file, default org_id. A private deployment takes the organization from YI_PRIVATE_ORG_ID, so this claim isn't used |
YI_OIDC_AUTHORIZATION_MODE | userinfo (default) rechecks membership and role at the provider's userinfo endpoint. login_only checks only at sign-in |
YI_AUTHORIZATION_RECHECK_SECONDS | How often the recheck runs, 5 to 300 seconds. Default 60 |
YI_ORG_ENROLLMENT | Leave at invite |
Connections
| Variable | Value |
|---|---|
YI_GIT_HOSTS | Git hosts that projects may use, comma-separated. Default github.com |
YI_CONNECTOR_HOSTS | Hosts allowed for model, knowledge and MCP endpoints, comma-separated. Offline, every endpoint must be on this list |
YI_GATEWAY_URL | YI_PUBLIC_URL followed by /v1/gateway. Execution hosts send model and tool calls here |
Execution
| Variable | Value |
|---|---|
YI_RUNTIME_IMAGE | The runtime image, pinned by digest. install.py sets it to the bundled image |
YI_MAX_CONCURRENCY | Turns running at the same time across the deployment, 1 to 10. Default 10 |
YI_MAX_RUN_SECONDS | Upper limit for a turn in seconds. Default 3600. Ask turns are capped at 900 seconds and Code turns at 3600 within it |
Execution hosts are registered as pools of type static, see Private and offline deployment.
Artifact storage
| Variable | Value |
|---|---|
YI_ARTIFACT_BACKEND | local (default) keeps artifacts on the control plane's volume. s3 uses S3-compatible object storage, needed for more than one API replica |
YI_ARTIFACT_ENDPOINT | The object storage URL, with s3 |
YI_ARTIFACT_BUCKET | The bucket, with s3 |
YI_ARTIFACT_PREFIX | Key prefix inside the bucket. Default yi-agent |
Keep as shipped
DO_NOT_TRACK=1 and LITELLM_LOCAL_MODEL_COST_MAP=True keep the bundled libraries from sending telemetry or fetching data from the internet.
Credential references
Fields such as "Credential reference (optional)" or "Git credential reference" take the name of an environment variable on the API server, not the secret. The name must start with your organization's prefix, shown at the end of the "Settings" page after "Your prefix:", for example YI_CREDENTIAL_…_GIT. The deployment administrator sets the value in the server's environment. The database stores only the name, and the app never shows a value.
A reference that has no value on the server is refused when you save it.
Models
Administrators add model endpoints in "Settings" under "Model endpoints":
- "OpenAI-compatible endpoint /v1" and "Deployment name", on a host in
YI_CONNECTOR_HOSTS. - "Output token parameter": the one the endpoint expects,
max_completion_tokens(the default) ormax_tokens, which many internal compatible endpoints use. - A credential reference, blank for an unauthenticated internal endpoint.
- Input, cached input and output rates in USD per million tokens. These are what turns are charged.
"Check endpoint" sends a real tool call and checks that the reply reports whole-number token usage. In production a model is offered only after it passes.
The HTTP API
The API is what the web app uses. It authenticates with the browser session and requires same-origin requests for changes. A deployment describes its routes in an OpenAPI document at /openapi.json.