Skip to content

Commit 287a110

Browse files
authored
chore(cleanup): remove dead chart options, the playground and legacy chat routes; contract retired DB objects (#10269)
* chore(cleanup): remove dead chart options, the playground and legacy chat routes; contract retired DB objects * fix(cleanup): address review findings * fix(emcn): drop the folder title and selection callback nothing reads * fix(egress): name both allowlists in the removed-variable startup error * chore(docs): refresh the compatibility baseline for changed pages * improvement(cleanup): drop dead folder plumbing and stale names left by the removals
1 parent 3153f6e commit 287a110

101 files changed

Lines changed: 35411 additions & 4061 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.claude/rules/sim-api-contracts.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Placement: the annotation must immediately precede the call or cast; up to three
3535

3636
```ts
3737
// boundary-raw-fetch: streaming SSE chunks must be processed as they arrive
38-
const response = await fetch(`/api/copilot/chat/stream?chatId=${chatId}`, { signal })
38+
const response = await fetch(`/api/mothership/chat/stream?streamId=${streamId}`, { signal })
3939
```
4040

4141
```ts

‎.cursor/rules/sim-api-contracts.mdc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Placement: the annotation must immediately precede the call or cast; up to three
3333

3434
```ts
3535
// boundary-raw-fetch: streaming SSE chunks must be processed as they arrive
36-
const response = await fetch(`/api/copilot/chat/stream?chatId=${chatId}`, { signal })
36+
const response = await fetch(`/api/mothership/chat/stream?streamId=${streamId}`, { signal })
3737
```
3838

3939
```ts

‎.github/CODEOWNERS‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
/apps/sim/app/api/mothership/chat/ @simstudioai/mothership
66
/apps/sim/app/api/mothership/chats/ @simstudioai/mothership
77
/apps/sim/app/api/mothership/execute/ @simstudioai/mothership
8-
/apps/sim/app/api/v1/copilot/chat/ @simstudioai/mothership
98

109
# Server-side stream orchestration, persistence, and protocol.
1110
/apps/sim/lib/copilot/chat/ @simstudioai/mothership

‎.github/CONTRIBUTING.md‎

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -179,31 +179,34 @@ Access the application at [http://localhost:3000/](http://localhost:3000/)
179179

180180
#### Using Local Models
181181

182-
To use local models with Sim:
182+
To use local models with Sim, either point it at an Ollama server you already run or start one alongside the stack.
183183

184-
1. Install Ollama and pull models:
184+
- **Ollama on your machine**: install it, pull a model, and point the app at the host:
185185

186-
```bash
187-
# Install Ollama (if not already installed)
188-
curl -fsSL https://ollama.ai/install.sh | sh
186+
```bash
187+
curl -fsSL https://ollama.ai/install.sh | sh
188+
ollama pull gemma3:4b
189189

190-
# Pull a model (e.g., gemma3:4b)
191-
ollama pull gemma3:4b
192-
```
190+
echo 'OLLAMA_URL=http://host.docker.internal:11434' >> .env
191+
docker compose -f docker-compose.prod.yml up -d
192+
```
193193

194-
2. Start Sim with local model support:
194+
Ollama must listen on an interface the container can reach (`OLLAMA_HOST=0.0.0.0:11434`). For an Ollama server elsewhere, set `OLLAMA_URL` to its address instead.
195195

196-
```bash
197-
# With NVIDIA GPU support
198-
docker compose --profile local-gpu -f docker-compose.ollama.yml up -d
196+
- **Bundled Ollama**: layer `docker-compose.ollama.yml` on the production file, with exactly one of the `gpu` or `cpu` profiles, then pull the starter model once:
199197

200-
# Without GPU (CPU only)
201-
docker compose --profile local-cpu -f docker-compose.ollama.yml up -d
198+
```bash
199+
echo 'OLLAMA_URL=http://ollama:11434' >> .env
202200

203-
# If hosting on a server, update the environment variables in the docker-compose.prod.yml file
204-
# to include the server's public IP then start again (OLLAMA_URL to i.e. http://1.1.1.1:11434)
205-
docker compose -f docker-compose.prod.yml up -d
206-
```
201+
# With NVIDIA GPU support
202+
docker compose -f docker-compose.prod.yml -f docker-compose.ollama.yml --profile gpu up -d
203+
204+
# Without GPU (CPU only)
205+
docker compose -f docker-compose.prod.yml -f docker-compose.ollama.yml --profile cpu up -d
206+
207+
# Pull gemma3:4b into the running server
208+
docker compose -f docker-compose.prod.yml -f docker-compose.ollama.yml --profile setup run --rm model-setup
209+
```
207210

208211
### Option 3: Manual Setup
209212

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<p align="center">
99
<a href="https://deepwiki.com/simstudioai/sim" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/badge/Ask-DeepWiki-E6E6E6?labelColor=C3C3C3&color=E6E6E6" alt="Ask DeepWiki"></a>
10-
<a href="https://cursor.com/link/prompt?text=Help%20me%20set%20up%20Sim%20locally.%20Follow%20these%20steps%3A%0A%0A1.%20First%2C%20verify%20Docker%20is%20installed%20and%20running%3A%0A%20%20%20docker%20--version%0A%20%20%20docker%20info%0A%0A2.%20Clone%20the%20repository%3A%0A%20%20%20git%20clone%20https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim.git%0A%20%20%20cd%20sim%0A%0A3.%20Generate%20required%20secrets%20%28the%20stack%20will%20not%20start%20without%20them%29%3A%0A%20%20%20cat%20%3E%20.env%20%3C%3C%20EOF%0A%20%20%20BETTER_AUTH_SECRET%3D%24%28openssl%20rand%20-hex%2032%29%0A%20%20%20ENCRYPTION_KEY%3D%24%28openssl%20rand%20-hex%2032%29%0A%20%20%20INTERNAL_API_SECRET%3D%24%28openssl%20rand%20-hex%2032%29%0A%20%20%20CRON_SECRET%3D%24%28openssl%20rand%20-hex%2032%29%0A%20%20%20POSTGRES_PASSWORD%3D%24%28openssl%20rand%20-hex%2024%29%0A%20%20%20EOF%0A%0A4.%20Start%20the%20services%20with%20Docker%20Compose%3A%0A%20%20%20docker%20compose%20-f%20docker-compose.prod.yml%20up%20-d%0A%0A5.%20Wait%20for%20all%20containers%20to%20be%20healthy%20%28this%20may%20take%201-2%20minutes%29%3A%0A%20%20%20docker%20compose%20-f%20docker-compose.prod.yml%20ps%0A%0A6.%20Verify%20the%20app%20is%20accessible%20at%20http%3A%2F%2Flocalhost%3A3000%0A%0AIf%20there%20are%20any%20errors%2C%20help%20me%20troubleshoot%20them.%20Common%20issues%3A%0A-%20Port%203000%20or%203002%20already%20in%20use%0A-%20Docker%20not%20running%0A-%20Insufficient%20memory%20%28needs%2012GB%2B%20RAM%29%0A%0AFor%20local%20AI%20models%20with%20Ollama%2C%20use%20one%20of%20these%20instead%20of%20step%204%3A%0A%20%20%20docker%20compose%20-f%20docker-compose.ollama.yml%20--profile%20gpu%20--profile%20setup%20up%20-d%0A%20%20%20docker%20compose%20-f%20docker-compose.ollama.yml%20--profile%20cpu%20--profile%20setup%20up%20-d%0AThen%20check%20status%20in%20step%205%20with%3A%0A%20%20%20docker%20compose%20-f%20docker-compose.ollama.yml%20ps"><img src="https://img.shields.io/badge/Set%20Up%20with-Cursor-E6E6E6?logo=cursor&logoColor=1A1A1A&labelColor=C3C3C3&color=E6E6E6" alt="Set Up with Cursor"></a>
10+
<a href="https://cursor.com/link/prompt?text=Help%20me%20set%20up%20Sim%20locally.%20Follow%20these%20steps%3A%0A%0A1.%20First%2C%20verify%20Docker%20is%20installed%20and%20running%3A%0A%20%20%20docker%20--version%0A%20%20%20docker%20info%0A%0A2.%20Clone%20the%20repository%3A%0A%20%20%20git%20clone%20https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim.git%0A%20%20%20cd%20sim%0A%0A3.%20Generate%20required%20secrets%20%28the%20stack%20will%20not%20start%20without%20them%29%3A%0A%20%20%20cat%20%3E%20.env%20%3C%3C%20EOF%0A%20%20%20BETTER_AUTH_SECRET%3D%24%28openssl%20rand%20-hex%2032%29%0A%20%20%20ENCRYPTION_KEY%3D%24%28openssl%20rand%20-hex%2032%29%0A%20%20%20INTERNAL_API_SECRET%3D%24%28openssl%20rand%20-hex%2032%29%0A%20%20%20CRON_SECRET%3D%24%28openssl%20rand%20-hex%2032%29%0A%20%20%20POSTGRES_PASSWORD%3D%24%28openssl%20rand%20-hex%2024%29%0A%20%20%20EOF%0A%0A4.%20Start%20the%20services%20with%20Docker%20Compose%3A%0A%20%20%20docker%20compose%20-f%20docker-compose.prod.yml%20up%20-d%0A%0A5.%20Wait%20for%20all%20containers%20to%20be%20healthy%20%28this%20may%20take%201-2%20minutes%29%3A%0A%20%20%20docker%20compose%20-f%20docker-compose.prod.yml%20ps%0A%0A6.%20Verify%20the%20app%20is%20accessible%20at%20http%3A%2F%2Flocalhost%3A3000%0A%0AIf%20there%20are%20any%20errors%2C%20help%20me%20troubleshoot%20them.%20Common%20issues%3A%0A-%20Port%203000%20or%203002%20already%20in%20use%0A-%20Docker%20not%20running%0A-%20Insufficient%20memory%20%28needs%2012GB%2B%20RAM%29%0A%0AFor%20local%20AI%20models%20with%20bundled%20Ollama%2C%20add%20OLLAMA_URL%3Dhttp%3A%2F%2Follama%3A11434%20to%20.env%2C%20then%20use%20one%20of%20these%20instead%20of%20step%204%20%28gpu%20needs%20an%20NVIDIA%20GPU%29%3A%0A%20%20%20docker%20compose%20-f%20docker-compose.prod.yml%20-f%20docker-compose.ollama.yml%20--profile%20gpu%20up%20-d%0A%20%20%20docker%20compose%20-f%20docker-compose.prod.yml%20-f%20docker-compose.ollama.yml%20--profile%20cpu%20up%20-d%0APull%20the%20starter%20model%20once%20Ollama%20is%20running%3A%0A%20%20%20docker%20compose%20-f%20docker-compose.prod.yml%20-f%20docker-compose.ollama.yml%20--profile%20setup%20run%20--rm%20model-setup%0AThen%20check%20status%20in%20step%205%20with%20the%20profile%20you%20started%3A%0A%20%20%20docker%20compose%20-f%20docker-compose.prod.yml%20-f%20docker-compose.ollama.yml%20--profile%20gpu%20ps%0A%20%20%20docker%20compose%20-f%20docker-compose.prod.yml%20-f%20docker-compose.ollama.yml%20--profile%20cpu%20ps"><img src="https://img.shields.io/badge/Set%20Up%20with-Cursor-E6E6E6?logo=cursor&logoColor=1A1A1A&labelColor=C3C3C3&color=E6E6E6" alt="Set Up with Cursor"></a>
1111
</p>
1212

1313
<p align="center">

‎apps/docs/content/docs/platform/self-hosting/docker.mdx‎

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -145,30 +145,64 @@ docker compose -f docker-compose.prod.yml up -d
145145
Container `localhost` is the container itself. The default `http://localhost:11434` does not reach an Ollama server on the host.
146146
</Callout>
147147

148-
### Development Ollama stack
148+
### Bundled Ollama
149149

150-
`docker-compose.ollama.yml` builds the app, realtime, and migrations from source. It does not bundle Redis or cron. Without Redis, pub/sub is process-local and CLI pairing approval has no fallback; idempotency and execution-progress storage can fall back to PostgreSQL. Without a scheduler, background jobs do not run.
150+
`docker-compose.ollama.yml` is an overlay on `docker-compose.prod.yml`: it adds an Ollama server to the production stack and points the app at it, so the stack keeps the published images, the required secrets, Redis, and cron. Ollama is reachable only inside the Compose network, as `ollama:11434`.
151151

152-
Use a server profile together with `setup`; `setup` alone starts no Ollama server and the model setup waits:
152+
Add the address to `.env` first. The overlay refuses to start without it, and keeping it in `.env` means a later run of `docker-compose.prod.yml` alone still reaches Ollama:
153153

154154
```bash
155-
# NVIDIA GPU
156-
docker compose -f docker-compose.ollama.yml --profile gpu --profile setup up -d
155+
OLLAMA_URL=http://ollama:11434
156+
```
157+
158+
Start the stack with exactly one server profile:
159+
160+
```bash
161+
# NVIDIA GPU (requires the NVIDIA Container Toolkit)
162+
docker compose -f docker-compose.prod.yml -f docker-compose.ollama.yml --profile gpu up -d
157163

158164
# CPU only
159-
docker compose -f docker-compose.ollama.yml --profile cpu --profile setup up -d
165+
docker compose -f docker-compose.prod.yml -f docker-compose.ollama.yml --profile cpu up -d
166+
```
167+
168+
Pull the starter model, `gemma3:4b`, once the server is running:
169+
170+
```bash
171+
docker compose -f docker-compose.prod.yml -f docker-compose.ollama.yml --profile setup run --rm model-setup
160172
```
161173

162-
Setup pulls `gemma3:4b`. To pull another model:
174+
To pull another model, exec into the server for your profile:
163175

164176
```bash
165177
# GPU profile
166-
docker compose -f docker-compose.ollama.yml exec ollama ollama pull llama3.2
178+
docker compose -f docker-compose.prod.yml -f docker-compose.ollama.yml --profile gpu exec ollama ollama pull llama3.2
167179

168180
# CPU profile
169-
docker compose -f docker-compose.ollama.yml exec ollama-cpu ollama pull llama3.2
181+
docker compose -f docker-compose.prod.yml -f docker-compose.ollama.yml --profile cpu exec ollama-cpu ollama pull llama3.2
170182
```
171183

184+
#### Migrating from the previous Ollama stack
185+
186+
The previous `docker-compose.ollama.yml` was a standalone stack with the fixed project name `sim-with-ollama`, so its database and models live in the `sim-with-ollama_postgres_data` and `sim-with-ollama_ollama_data` volumes. The overlay takes its project name from `docker-compose.prod.yml`, and started as-is it creates empty volumes instead. To keep your data:
187+
188+
1. From the repository directory, stop the old stack without `-v`, so its volumes are kept. The old file is gone, so name the project instead:
189+
190+
```bash
191+
docker compose -p sim-with-ollama down
192+
```
193+
194+
2. Add the old project name and database password to `.env`, so the overlay and the `sim-setup` CLI both resolve the same project and volumes. The old stack's password defaulted to `postgres` unless you set one:
195+
196+
```bash
197+
COMPOSE_PROJECT_NAME=sim-with-ollama
198+
POSTGRES_PASSWORD=postgres
199+
OLLAMA_URL=http://ollama:11434
200+
```
201+
202+
3. Start the stack with the overlay and your profile, as above.
203+
204+
Ollama is no longer published on host port `11434`. Reach it with `docker compose exec`, as in the model pull commands above.
205+
172206
## LM Studio
173207

174208
Start [LM Studio's local server](https://lmstudio.ai/docs/developer/core/server), load a model, enable **Serve on Local Network**, and [configure API authentication](https://lmstudio.ai/docs/developer/core/authentication). Save these values beside your Compose file:
@@ -184,13 +218,14 @@ Recreate the app using the file that started your installation:
184218

185219
```bash
186220
COMPOSE_FILE=docker-compose.prod.yml
187-
# For a source-built stack, use docker-compose.local.yml or docker-compose.ollama.yml.
221+
# For a source-built stack, use docker-compose.local.yml. With bundled Ollama,
222+
# add the overlay: -f docker-compose.prod.yml -f docker-compose.ollama.yml
188223
docker compose -f "$COMPOSE_FILE" up -d --force-recreate simstudio
189224
```
190225

191226
## The `sim-setup` CLI
192227

193-
Invoke commands as `bunx sim-setup <command>` unless the package is installed globally. Run `doctor`, `config`, and the wizard from the configuration directory. Lifecycle commands discover running production/local Compose stacks, source checkouts, and Helm releases; Ollama-stack installs are not managed.
228+
Invoke commands as `bunx sim-setup <command>` unless the package is installed globally. Run `doctor`, `config`, and the wizard from the configuration directory. Lifecycle commands discover running production/local Compose stacks, source checkouts, and Helm releases. A stack started with the Ollama overlay is managed as a production install, through `docker-compose.prod.yml` alone: the CLI acts on the Sim services and leaves the Ollama container untouched.
194229

195230
| Command | Behavior |
196231
| --- | --- |

‎apps/docs/content/docs/platform/self-hosting/environment-variables.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ Configure at least one. Every configured provider stays active and is tried in o
260260
| `RESUME_EXECUTION_CONCURRENCY_LIMIT` | `50` | Trigger.dev resume task concurrency |
261261
| `EGRESS_ALLOWED_HOSTS` | unset | Comma-separated hostnames outbound requests may reach on a private network. Leading wildcard allowed, e.g. `host.docker.internal,*.svc.cluster.local`. Not honored for URLs harvested from content or a third-party response, nor for an HTTP block's `proxyUrl` |
262262
| `EGRESS_ALLOWED_IP_RANGES` | unset | Comma-separated CIDRs or IPs outbound requests may reach on a private network, e.g. `10.0.0.0/8`. Same exclusions |
263-
| `ALLOW_PRIVATE_DATABASE_HOSTS` | unset | **Deprecated.** Vouches for the entire private address space, for database, cache, and mail connector hosts only. Replace it with the two settings above naming specific destinations |
263+
| `ALLOW_PRIVATE_DATABASE_HOSTS` | unset | **Removed.** Has no effect; the app logs an error at startup if it is still set. Name each database, cache, or mail host in `EGRESS_ALLOWED_HOSTS` instead; a host reached by IP address, including any IPv6 literal (which `EGRESS_ALLOWED_HOSTS` rejects), takes a single-address entry such as `10.0.0.5/32` in `EGRESS_ALLOWED_IP_RANGES`. Do not allowlist whole private ranges, which would widen what workflow HTTP blocks can reach, or `localhost`, where Sim's own database and Redis listen |
264264
| `DOMAIN_VERIFICATION_NAMESERVERS` | `1.1.1.1,8.8.8.8` | Comma-separated nameserver IPs that SSO domain verification sends its TXT lookup to. Set it when the network only allows DNS to an internal resolver. Entries that are not IP addresses are ignored |
265265

266266
A malformed entry in either allowlist stops the app at startup with a message naming the setting. See [the SSRF boundary](/platform/self-hosting/security#the-ssrf-boundary) for the accepted syntax and for what the allowlist does and does not reach.

‎apps/docs/content/docs/platform/self-hosting/observability.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Deploy the PII service, configure its internal network path, and enable the stor
7171
## Metrics
7272

7373
<Callout type="warn">
74-
The default app and realtime images **do not expose a `/metrics` endpoint**. The chart's `monitoring.serviceMonitor` option exists for builds that do — enabling it against the stock images produces a ServiceMonitor that scrapes nothing.
74+
The app and realtime images **do not expose a `/metrics` endpoint**, and the Helm chart ships no ServiceMonitor. There is nothing for Prometheus to scrape from the Sim pods directly.
7575
</Callout>
7676

7777
Until an application metrics endpoint ships, build alerting from the signals that do exist:

‎apps/docs/content/docs/platform/self-hosting/security.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ EGRESS_ALLOWED_HOSTS=host.docker.internal
271271

272272
Review these compatibility cases when upgrading:
273273

274-
- **`ALLOW_PRIVATE_DATABASE_HOSTS`** still works, but it is deprecated and logs a warning at startup. It vouches for the whole private address space, loopback included, for database, cache, and mail connector hosts. Replace it with `EGRESS_ALLOWED_HOSTS` or `EGRESS_ALLOWED_IP_RANGES` naming the hosts you actually use.
274+
- **`ALLOW_PRIVATE_DATABASE_HOSTS`** has been removed and no longer has any effect; the app logs an error at startup if it is still set. Name the specific database, cache, and mail hosts you use in `EGRESS_ALLOWED_HOSTS`. A host you reach by IP address needs a single-address entry in `EGRESS_ALLOWED_IP_RANGES` instead (for example `10.0.0.5/32`, or `fd00::5/128`); IPv6 literals in particular must go there, since `EGRESS_ALLOWED_HOSTS` rejects them. Do not allowlist whole private ranges in its place, since the allowlist also applies to workflow HTTP blocks and that would widen what every workflow author can reach, and do not allowlist `localhost`, where Sim's own database and Redis listen.
275275
- **1Password Connect** on a private, non-loopback address, and an **MCP server** on a private address or reached through a DNS name that points at loopback, are no longer reachable implicitly. Name them.
276276
- **`ALLOWED_MCP_DOMAINS`** governs which domains may be used; it no longer disables the address check, so an MCP server on a private address needs the allowlist too.
277277
- **Content fetches** — an image URL, a file imported by URL, an MCP OAuth endpoint on a different origin than the MCP server itself — never use the allowlist. Those destinations have to be publicly routable. (An SSO OIDC *discovery* URL is a configured endpoint and does use the allowlist; the endpoints named *inside* the discovery document are validated as content when Sim registers the provider, so an internal IdP endpoint is refused there and cannot be allowlisted — provide the endpoints explicitly to have them validated as configured endpoints instead.)

0 commit comments

Comments
 (0)