Deep Dive Inside FlowSquad's Multi-LLM Architecture: Why We Never Lock You In
Deep-Dive Platform Engineers ยท Architects

Inside FlowSquad's Multi-LLM Architecture: Why We Never Lock You In

OpenAI today, Anthropic tomorrow, local Ollama next year. FlowSquad's provider pattern means a single config change swaps your LLM โ€” no code changes required.

April 8, 2026 · 10 min read · Platform EngineersArchitects
TL;DR

What Is LLM Vendor Lock-In and Why Should You Care?

LLM vendor lock-in occurs when your application's AI capabilities are so tightly coupled to a single provider's API โ€” model names, prompt formats, token limits, rate-limit handling โ€” that migrating to a competitor requires a significant rewrite. For enterprise software teams, this is not a theoretical risk. OpenAI's GPT-4 Turbo has seen 3 major pricing changes in 18 months. Anthropic's Claude models regularly surpass GPT-4 on coding benchmarks. A new open-weight model can emerge and obsolete cloud pricing overnight.

The real cost of lock-in is not just the migration effort โ€” it is the strategic paralysis. When switching providers costs weeks of engineering time, teams delay decisions that could dramatically reduce costs or improve output quality. For a team spending $3,000/month on GPT-4 calls that Ollama Mistral could handle at infrastructure cost alone, lock-in is a recurring monthly tax.

FlowSquad's Multi-LLM Architecture was designed from day one to make the LLM a swappable configuration value, not an architectural dependency. Every feature โ€” Epic decomposition, story generation, code analysis, HLD/LLD design, test case generation, AskProduct Q&A โ€” routes through a provider abstraction layer that normalizes requests and responses regardless of the underlying model.

How Does FlowSquad's Provider Pattern Work?

At the core of FlowSquad's LLM infrastructure is a provider registry โ€” a dictionary of named adapters, each implementing a common interface with three methods: complete(prompt), stream(prompt), and embed(text). When a feature like Story Generation issues an LLM call, it calls the registry with the configured provider name. The registry resolves the adapter, injects model parameters, handles retries, and returns a normalized response object.

This means zero application code changes when switching providers. The 12 LLM-powered features in FlowSquad all consume the same interface. Provider-specific quirks โ€” Anthropic's max_tokens_to_sample vs OpenAI's max_tokens, Claude's system prompt format vs GPT-4's message role format โ€” are encapsulated entirely within each adapter class.

# FlowSquad LLM Provider Configuration โ€” config.yaml llm: provider: "openai" # Switch to: anthropic | azure | ollama model: "gpt-4-turbo" api_key_env: "OPENAI_API_KEY" # Fernet-encrypted at rest temperature: 0.3 max_tokens: 4096 # To switch to Ollama (on-premise, zero cost): llm: provider: "ollama" model: "mistral:7b-instruct" # or llama2:13b base_url: "http://ollama.internal:11434" temperature: 0.3 max_tokens: 4096 # No API key required โ€” air-gapped friendly

Which LLMs Does FlowSquad Support Out of the Box?

FlowSquad ships with 5 production-ready LLM provider adapters covering the most widely used commercial and open-weight models available in 2025โ€“2026. Each adapter is tested against FlowSquad's full feature suite, including structured JSON output requirements (for Epic/Story/Task decomposition), long-context requirements (for full-codebase analysis), and streaming requirements (for real-time UI feedback).

ProviderModelContext WindowCost / 1k Input TokensOn-Premise?
OpenAIGPT-4 Turbo128,000 tokens$0.01Cloud only
AnthropicClaude 3.5 Sonnet200,000 tokens$0.003Cloud only
Azure OpenAIGPT-4o / GPT-4 Turbo128,000 tokens$0.01 (enterprise)Azure VNet
OllamaLlama2 (7B / 13B / 70B)4,096 tokens$0.00Full air-gap
OllamaMistral 7B Instruct8,192 tokens$0.00Full air-gap

Azure OpenAI is particularly valuable for enterprises already contracted with Microsoft โ€” the model is identical to OpenAI's offering but routes through your own Azure subscription, qualifying for existing enterprise agreements and data residency commitments. All API keys are stored as Fernet-encrypted (AES-128) fields in the database, never as plain text.

How Do You Switch LLM Providers in Production?

Switching LLM providers in FlowSquad requires exactly 4 actions: navigate to Admin โ†’ LLM Configuration, select a new provider from the dropdown, enter the new API key (or leave blank for Ollama), click Save. The change takes effect on the next request โ€” there is no service restart, no migration script, no downtime window. The previous provider's API key is retained in encrypted storage so you can roll back instantly.

For teams operating in CI/CD pipelines or infrastructure-as-code environments, the FlowSquad Setup Wizard also exposes LLM configuration via environment variables. Setting FLOWSQUAD_LLM_PROVIDER=anthropic and ANTHROPIC_API_KEY=sk-ant-... in your deployment manifest is sufficient to boot FlowSquad with Claude as the default model โ€” no UI interaction required.

A/B testing between providers is supported via FlowSquad's product-level LLM override: your production product can use GPT-4 while a staging product uses Mistral, all within the same FlowSquad instance. This allows side-by-side quality comparison on real workloads before committing to a provider switch.

What Is the Performance Difference Between Providers?

Based on internal benchmarking across 500 Epic decomposition requests using the same 10 test prompts across providers, the following latency and quality characteristics were observed. Note that Ollama performance is highly hardware-dependent โ€” a 4ร— A100 GPU server will outperform a CPU-only host by over 10ร—.

GPT-4 Turbo produces the highest structural consistency for Epic/Story/Task JSON output (98.2% valid JSON on first attempt) and handles ambiguous product requirements most gracefully. Average latency for a full 10-story Epic decomposition: 4.2 seconds.

Claude 3.5 Sonnet excels on long-context analysis tasks. For HLD/LLD generation from large codebases (50k+ tokens), Claude outperforms GPT-4 Turbo on coherence metrics by ~12% based on reviewer ratings, while costing 70% less per token. Average latency: 5.8 seconds.

Ollama Mistral 7B on mid-tier GPU hardware (RTX 3090) achieves ~18 tokens/second throughput. For teams with on-premise GPU resources, this effectively eliminates per-request AI costs while keeping all data within the enterprise perimeter โ€” critical for air-gapped environments and organizations subject to data sovereignty regulations.

Frequently Asked Questions

Can I use a custom or fine-tuned model with FlowSquad?

Yes. If your fine-tuned model is served via an OpenAI-compatible API (as most Ollama models and many fine-tuning platforms are), you can point FlowSquad's Ollama adapter at it by setting the base_url and model fields. Full custom adapter support for arbitrary APIs is on the roadmap for Q2 2026.

Does switching providers affect stored analysis results?

No. FlowSquad stores all generated content (Epics, Stories, HLD/LLD, test cases) as structured data in the application database, independent of which LLM produced them. Switching providers only affects future generation requests โ€” historical content is never modified.

How does Ollama work in an air-gapped environment?

Ollama runs as a local HTTP server on your infrastructure. FlowSquad's Ollama adapter sends requests to http://your-ollama-host:11434 โ€” entirely within your network. No outbound internet connection is required. Model weights are downloaded once to your Ollama server; FlowSquad itself never contacts external model registries.

Is the provider switch per-product or global?

Both. A global default LLM provider is set in Admin โ†’ LLM Configuration. Individual products can override this default with a product-level provider selection, allowing different products to use different models simultaneously within the same FlowSquad instance.

How are LLM API keys secured at rest?

All LLM API keys are encrypted using Fernet (AES-128) symmetric encryption before being written to the database. The encryption key is stored as an environment variable on the host, never in the database itself. This means a database breach exposes only ciphertext โ€” the keys remain protected as long as the environment variable is not compromised.

Share on dev.to Share on Hashnode Share on Medium Share on LinkedIn