Skip to content

✨ feat(compose): support host Ollama and OpenAI embeddings - #333

Open
yeazelm wants to merge 2 commits into
mainfrom
matt/pcc-1284-compose-should-support-host-ollama-and-openai-embedding
Open

✨ feat(compose): support host Ollama and OpenAI embeddings#333
yeazelm wants to merge 2 commits into
mainfrom
matt/pcc-1284-compose-should-support-host-ollama-and-openai-embedding

Conversation

@yeazelm

@yeazelm yeazelm commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • keep the root docker-compose.yaml as the simplest fully containerized stack
  • add standalone compose/native-ollama and compose/openai-embeddings deployment recipes, each with its own README
  • use native Ollama for GPU-accelerated background embeddings when available
  • use OpenAI only for background span embeddings while retaining containerized Ollama for synchronous local work
  • document the expected CPU tradeoff, native-Ollama preflight checks, API-key setup, and provider-switch re-embedding behavior

Why

The default should remain one command that launches everything and demonstrates the complete local system. Its known tradeoff is that Docker Desktop cannot expose the Apple GPU to the ordinary Ollama Linux container, so a finished capture may leave background embedding consuming CPU for some time.

The two standalone recipes address that less-obvious background workload without pretending local Tapes will match Paper's cloud performance:

  • compose/native-ollama sends Ollama traffic to the host and verifies embeddinggemma is available before search starts.
  • compose/openai-embeddings sends only background span embeddings to OpenAI. Synchronous work such as skill generation can remain slower in containerized Ollama.

On an M5 Pro, the same embeddinggemma backlog measured:

Runtime Throughput
Docker Ollama, CPU-only ~18.5 embeddings/min
Native Ollama, Metal ~1,760 embeddings/min

Native Ollama completed 955 embeddings in about 33 seconds—roughly 95x faster—with no embedding failures.

Usage

# Default: everything in Docker
docker compose up --build

# Native Ollama
cd compose/native-ollama
docker compose up --build

# OpenAI background embeddings
cd compose/openai-embeddings
cp .env.example .env
# Set OPENAI_API_KEY in .env
docker compose up --build

Validation

  • make format
  • make test
  • make check
  • all three Compose files pass docker compose config --quiet
  • the standalone native-Ollama recipe was started with --build --wait; its model preflight completed, all services became healthy, and GET /ping returned pong
  • live host Ollama reported 100% GPU, the embedding queue drained, and subsequent search passes reported zero outstanding embeddings

Linear

Fixes PCC-1284

@linear-code

linear-code Bot commented Aug 25, 2026

Copy link
Copy Markdown

PCC-1284

@yeazelm
yeazelm marked this pull request as ready for review August 26, 2026 22:13
@greptile-apps

greptile-apps Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR keeps the root Compose stack as the fully containerized default and adds standalone recipes for host-native Ollama and OpenAI-backed background embeddings.

  • Adds a native-Ollama recipe with host routing and an embedding-model preflight.
  • Adds an OpenAI embedding recipe that retains containerized Ollama for synchronous work.
  • Documents setup, provider switching, performance tradeoffs, and lifecycle commands.
  • Adds environment-file protection and a non-destructive make down target.

Confidence Score: 5/5

The PR appears safe to merge with no concrete changed-code defect established.

The new recipes consistently separate background embedding providers from synchronous Ollama usage, gate native search on its model preflight, require the OpenAI key during Compose interpolation, and document the relevant prerequisites.

Important Files Changed

Filename Overview
compose/native-ollama/compose.yaml Adds a host-Ollama stack whose search service waits for a successful embedding-model preflight.
compose/openai-embeddings/compose.yaml Adds an OpenAI-backed search configuration while retaining local Ollama for synchronous operations.
docs/installation.md Documents the three deployment modes, their operational tradeoffs, and safe switching instructions.
makefile Documents the existing up target and adds a volume-preserving Compose shutdown target.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  User[User] --> Default[Default Compose stack]
  User --> Native[Native Ollama recipe]
  User --> OpenAI[OpenAI embeddings recipe]
  Default --> DockerOllama[Containerized Ollama]
  Native --> HostOllama[Host Ollama]
  Native --> Preflight[Pull embeddinggemma]
  Preflight --> SearchNative[Background search embeddings]
  HostOllama --> SearchNative
  OpenAI --> OpenAISearch[OpenAI background embeddings]
  OpenAI --> LocalOllama[Containerized Ollama for synchronous work]
Loading

Reviews (1): Last reviewed commit: "♻️ refactor(compose): provide standalone..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant