What Are the Key Dimensions of the Self-Hosted vs. Cloud Decision?

This is not a simple cost comparison. The self-hosted vs. cloud decision for an AI-powered SDLC platform involves five distinct dimensions, and your organization's profile on each one will drive a different conclusion:

  1. Data sovereignty: Does your code or requirements data need to stay within a specific geographic or network boundary?
  2. Compliance regime: Are you subject to HIPAA, FedRAMP, GDPR, ISO 27001, or SOC 2 Type II audits that restrict data processing to known vendors?
  3. Scale and cost profile: Are you running 10 users or 500? How many SDLC artifacts are generated per day?
  4. Operational maturity: Does your team have the capacity to manage GPU infrastructure, model updates, and availability SLAs?
  5. Output quality requirements: Is state-of-the-art LLM quality essential, or is "good enough" local inference acceptable for your artifact quality bar?

Cloud LLMs (OpenAI/Anthropic) vs. Local LLMs (Ollama): Real Performance Tradeoffs

FlowSquad's Multi-LLM support covers OpenAI GPT-4, Anthropic Claude 3.5 Sonnet, Azure OpenAI (any deployment), and Ollama (local models including Llama 3.1 70B, Mistral 8ร—7B, CodeLlama 34B).

Cloud LLMs โ€” Strengths

GPT-4 and Claude 3.5 Sonnet represent the current quality ceiling for code-aware text generation. In FlowSquad's internal benchmarks, GPT-4-generated stories score 4.7/5 on developer usability ratings versus 3.9/5 for Llama 3.1 70B on equivalent prompts. Cloud models also require zero infrastructure: you configure an API key, and FlowSquad handles the rest.

The cost profile for cloud LLMs in FlowSquad is predictable via the LLM cost tracker: generating a full epic breakdown (1 epic, 5 stories, 15 tasks) costs approximately $0.04โ€“0.08 using GPT-4 Turbo at current pricing. For a team generating 200 stories per sprint, that's $8โ€“16 per sprint in LLM costs โ€” negligible against engineering salary costs.

Local LLMs via Ollama โ€” Strengths

Ollama-backed deployments eliminate the data-egress concern entirely. Your source code, your requirements, your prompts โ€” nothing leaves your network. For a defense contractor, a healthcare provider, or a financial institution under strict data handling agreements, this is not a nice-to-have; it's a compliance requirement.

The cost profile inverts: after the hardware investment (an NVIDIA A100 80GB costs approximately $10,000โ€“15,000), per-inference cost drops to near zero. For organizations running >5,000 SDLC artifact generations per month, the break-even point against cloud API costs is approximately 18โ€“24 months.

The latency penalty is real: a typical story generation that takes 4.2 seconds on GPT-4 takes 8.8 seconds on Llama 3.1 70B on a single A100. For interactive use (single story generation), this is acceptable. For batch processing (generating 50 stories in a sprint), the difference is material.

# FlowSquad config.yaml โ€” LLM backend selection llm: provider: ollama # options: openai | anthropic | azure | ollama model: llama3.1:70b # or: gpt-4-turbo | claude-3-5-sonnet | gpt-4 base_url: http://ollama.internal:11434 # for ollama only api_key: ${OLLAMA_API_KEY} # optional for local ollama max_tokens: 4096 temperature: 0.3 # Cost tracking (applies to cloud providers) cost_tracking: enabled: true alert_threshold_usd: 50.00 # per month log_per_request: true

ChromaDB (Local) vs. Pinecone (Cloud): When Does It Matter?

FlowSquad's VectorDB stores the semantic embeddings of your codebase that power the AskProduct Q&A and codebase-grounded story generation. The choice between ChromaDB and Pinecone is often misunderstood as purely a performance decision โ€” it's primarily a data residency decision.

ChromaDB runs locally alongside FlowSquad. Your code embeddings never leave your infrastructure. It handles repositories up to approximately 2 million lines of code comfortably on a single 16GB RAM node. For the vast majority of enterprise repositories, this is sufficient. Index build time for a 500,000-line Java monorepo is approximately 12 minutes on first analysis; incremental updates take under 60 seconds.

Pinecone is a managed cloud VectorDB optimized for scale. It becomes relevant when: (a) you're indexing repositories exceeding 5 million lines, (b) you need multi-region VectorDB replication for a globally distributed team, or (c) you want to offload VectorDB infrastructure management entirely. Pinecone's query latency at scale is ~30% lower than ChromaDB at equivalent index sizes above 10M vectors.

For regulated environments, the answer is almost always ChromaDB โ€” not because it's better, but because sending code embeddings to a third-party cloud service raises the same compliance concerns as sending code to OpenAI.

PostgreSQL vs. SQLite: Which Database Backend Is Right?

FlowSquad uses a relational database for its operational data: users, projects, stories, audit logs, RBAC configurations, and LLM cost records. The choice between PostgreSQL and SQLite is simple:

  • SQLite: Use for single-node evaluation, development environments, or teams under 10 users. Zero configuration, included in the default Docker image. Not suitable for production multi-user deployments โ€” write contention under concurrent sessions causes degraded performance above ~5 simultaneous users.
  • PostgreSQL: Use for all production deployments. Supports full RBAC, concurrent access, and the audit log and field-level encryption (Fernet/AES-128) features that require proper transaction isolation. A standard PostgreSQL 15+ instance with 4GB RAM handles a 100-user FlowSquad deployment without resource pressure.

Decision Matrix: Cloud vs. Self-Hosted by Criteria

CriteriaCloud (OpenAI + Pinecone + managed DB)Self-Hosted (Ollama + ChromaDB + PostgreSQL)FlowSquad Default
Initial setup time~30 minutes~4โ€“8 hours (GPU + k8s config)Cloud (10-step wizard)
Per-story generation cost~$0.04โ€“0.08 (GPT-4 Turbo)~$0.001โ€“0.003 (amortized GPU)Cloud
Output quality (developer rating)4.7 / 53.9 / 5 (Llama 3.1 70B)Cloud
Story generation latency~4 seconds~9 seconds (A100 single GPU)Cloud
Data leaves your network?Yes โ€” API calls to OpenAI/AnthropicNo โ€” fully localSelf-hosted (regulated)
HIPAA / FedRAMP compatibleRequires BAA with OpenAI/AzureYes โ€” no third-party data flowSelf-hosted
Operational overheadMinimal โ€” managed APIsHigh โ€” GPU maintenance, model updatesCloud
Scaling to 500+ usersAuto-scales via APIRequires GPU cluster expansionCloud
Works in air-gapped networkNoYesSelf-hosted
LLM model customization (fine-tuning)Limited (fine-tune API)Full control (LoRA, QLoRA)Self-hosted (advanced)

How Do You Make the Decision for Your Organization?

Decision Framework โ€” answer in order, stop when you have your answer

  1. Is your code subject to a data residency requirement or air-gap mandate? โ†’ If yes: Self-hosted (Ollama + ChromaDB + PostgreSQL).
  2. Do you need HIPAA/FedRAMP compliance without a cloud vendor BAA? โ†’ If yes: Self-hosted.
  3. Is your repository larger than 5M lines and do you have a globally distributed team? โ†’ If yes: Cloud (Pinecone + OpenAI) for scale.
  4. Do you have fewer than 50 users and no compliance constraints? โ†’ Cloud (fastest to value, lowest TCO under 18 months).
  5. Are you running >5,000 AI generations per month with a stable infrastructure team? โ†’ Self-hosted (long-term cost advantage).
  6. Default: Start with Cloud; migrate to Self-hosted after proving value and quantifying volume.

Frequently Asked Questions

Can FlowSquad switch between cloud and self-hosted LLMs without re-installing?
Yes. FlowSquad's LLM provider is a configuration parameter in config.yaml. Switching from OpenAI to Ollama requires updating 3 fields: provider, model, and base_url. No data migration is required. The codebase index in ChromaDB uses the same embedding format regardless of the generation LLM.
Does the VectorDB need to be rebuilt when switching LLM providers?
Only if you change the embedding model. If you switch from OpenAI GPT-4 to Anthropic Claude for generation but keep the same embedding model (e.g., text-embedding-3-large), no rebuild is needed. Switching the embedding model requires a full index rebuild, which takes 10โ€“45 minutes depending on repository size.
What Kubernetes configuration does FlowSquad recommend for self-hosted production?
FlowSquad's Kubernetes deployment includes a Helm chart with configurable resource requests. Recommended minimum for production: FlowSquad API pod (4 vCPU, 8GB RAM), PostgreSQL StatefulSet (4 vCPU, 8GB RAM), ChromaDB pod (2 vCPU, 16GB RAM for the vector index), Ollama pod (GPU node with โ‰ฅ16GB VRAM for 13B models, โ‰ฅ80GB for 70B models).
How does FlowSquad's field-level encryption work in the self-hosted configuration?
FlowSquad's field-level encryption uses Fernet (AES-128 CBC + HMAC-SHA256) for sensitive fields (API tokens, user credentials, requirement text). In self-hosted mode, the encryption key is stored in a Kubernetes Secret or HashiCorp Vault. In cloud mode, it's managed via your configured KMS. The encryption is transparent to users and doesn't affect query performance.
Can we use Azure OpenAI instead of OpenAI directly for data residency?
Yes. FlowSquad supports Azure OpenAI as a distinct provider. Azure OpenAI runs GPT-4 models within your Azure tenant's geographic region, which satisfies many data residency requirements without requiring full self-hosting. Configure provider: azure with your Azure endpoint, deployment name, and API key in FlowSquad's LLM settings.