Building a Secure and Scalable LLM Gateway for Enterprise GenAI Adoption

wealthsimple · Finance · 2024 · source Agentic: no · promotional bias: low · source-backed · extracted with prompt 0.5.4 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Financial-services internal GenAI platform

Wealthsimple wanted employees to benefit from generative AI without leaking sensitive financial data to third-party providers, while supporting provider optionality, reliability, multimodal inputs, RAG, self-hosted models, employee adoption, and future client-facing GenAI work.

Constraints:

Architecture

Wealthsimple built a centralized LLM gateway and internal GenAI platform. The gateway proxies employee and production-system requests to providers, records audit trails, supports model selection, retries, fallback, and rate-limit work, and later moved toward OpenAI-compatible APIs. The platform adds a custom PII redaction model for external providers, self-hosted open-source LLMs via llama.cpp for sensitive unredacted data, a semantic-search RAG API, a Streamlit data-app platform, multimodal uploads, and internal productivity tools grounded in Wealthsimple context.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  employee[Employee] --> llm-gateway[LLM Gateway]
  employee[Employee] --> boosterpack[Boosterpack]
  employee[Employee] --> data-applications-platform[Data Applications Platform]
  llm-gateway[LLM Gateway] --> pii-redaction-model[PII Redaction Model]
  llm-gateway[LLM Gateway] --> external-llm-providers[External LLM Providers]
  llm-gateway[LLM Gateway] --> self-hosted-llms[Self Hosted LLMs]
  llm-gateway[LLM Gateway] --> rag-api[RAG API]
  rag-api[RAG API] --> company-context[Company Context]
  company-context[Company Context] --> boosterpack[Boosterpack]
  data-applications-platform[Data Applications Platform] --> llm-gateway[LLM Gateway]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Employee Internal Wealthsimple user seeking productivity help from GenAI tools. LLM Gateway, Boosterpack, Data Applications Platform
LLM Gateway Central proxy for provider access, audit trails, model selection, retries, fallback, and API access. Employee, PII Redaction Model, External LLM Providers, Self Hosted LLMs, RAG API
PII Redaction Model Custom model that detects and redacts sensitive information before external provider calls. LLM Gateway
External LLM Providers Provider endpoints such as OpenAI, Cohere, Gemini, and Bedrock-accessible models. LLM Gateway
Self Hosted LLMs Open-source models hosted in Wealthsimple cloud environments using llama.cpp. LLM Gateway
RAG API Semantic-search API for grounding LLM applications in company context. LLM Gateway, Company Context
Company Context Internal Wealthsimple knowledge and data used for grounded assistant experiences. RAG API, Boosterpack
Data Applications Platform Python and Streamlit platform for internal GenAI proof-of-concept applications. Employee, LLM Gateway
Boosterpack Employee personal assistant grounded against Wealthsimple context. Employee, Company Context

Data flow

An employee or internal application sends a prompt through the gateway. The gateway logs who sent what data and where it goes, proxies requests to selected LLM providers with retry/fallback behavior, redacts PII for external providers when needed, or routes sensitive unredacted work to self-hosted models. Developers can build on the RAG API and data-app platform, while adoption is guided by nudges, guidelines, and making the gateway free and convenient.

4 supporting quotes
“The first version of our gateway did one thing: it maintained an audit trail. It would track what data was being sent externally, where it was being sent, and who sent it.”article, stated
“it would proxy the information from the conversation, send it to various LLM providers such as OpenAI, and track this information.”article, stated
“Our production systems could also interact with these models programmatically through an API endpoint from our LLM service, which also handles retry and fallback mechanisms.”article, stated
“Next we introduced a very simple semantic search as our first RAG API. We encouraged our developers and our end users to build upon this API and other building blocks we provided in order to leverage LLMs grounded against our company context.”article, stated

Why this architecture

Wealthsimple chose a gateway rather than banning LLMs because it wanted the secure path to be the easy path. Audit trails, redaction, self-hosted models, RAG, and provider optionality let employees use GenAI while keeping sensitive data controls and reliability inside a financial-services environment.

3 supporting quotes
“we built a gateway that would address security and privacy concerns while also providing the freedom to explore.”article, stated
“Second, we wanted to create a centralized place to interact with all of the different LLM providers. At the beginning, it was just OpenAI and Cohere, but the list expanded as time went on.”article, stated
“Secondly, for them to effectively leverage LLMs in their day-to-day work, they needed to be able to use some unredacted PII, because that was the data they worked with. Going back to our philosophy of making the right way the easy way, we started to look into self-hosting open source LLMs.”article, stated

Models used: OpenAI models · Cohere models · Gemini 1-million-token context window models · self-hosted open-source LLMs · llama.cpp

Scale

Alternatives considered (roads not taken)

Ban employee use of ChatGPT and external LLMs

Rejected because: Wealthsimple wanted to capture GenAI productivity gains while controlling data exposure.

“many companies chose to ban employees from using ChatGPT”article, stated
“we built a gateway that would address security and privacy concerns while also providing the freedom to explore.”article, stated

Use PII redaction for all sensitive workflows

Rejected because: Redaction sometimes hurt answer relevance and employees sometimes needed unredacted PII for work.

“Many users reported that the PII redaction model was not always accurate, which often interfered with the relevancy of the answers provided.”article, stated
“Secondly, for them to effectively leverage LLMs in their day-to-day work, they needed to be able to use some unredacted PII, because that was the data they worked with. Going back to our philosophy of making the right way the easy way, we started to look into self-hosting open source LLMs.”article, stated

Expose a non-standard internal API

Rejected because: OpenAI API compatibility became necessary for integrations with LangChain and other libraries.

“Because OpenAI's API specs became the gold standard, we ran into a lot of headaches with integrations. We had to rewrite a lot of code from LangChain and other libraries and frameworks because we didn't offer a compatible API structure.”article, stated
“We took some time in September of 2024 to ship v2 of our API, which did mirror OpenAI's API specs. We learned that as the GenAI industry matures, it's important to think about what the right standards and integrations are.”article, stated

Patterns

model-routing (platform)

The gateway centralizes access to multiple LLM providers and lets users select models.

“we wanted to create a centralized place to interact with all of the different LLM providers.”article, stated

privacy-preserving-processing (security)

Wealthsimple uses PII redaction for external providers and self-hosted models when unredacted PII is needed.

“our own PII redaction model, which could detect and redact any potentially sensitive information prior to sending to external LLM providers.”article, stated
“the data would stay within our cloud environments.”article, stated

rag-retrieval (retrieval)

The first RAG API gave developers and users semantic search grounded in company context.

“we introduced a very simple semantic search as our first RAG API.”article, stated

fallback-degradation (resilience)

The LLM service handles retries and fallback to improve availability across providers.

“our LLM service, which also handles retry and fallback mechanisms.”article, stated

structured-output-contract (integration)

The v2 API mirrored OpenAI's API specs to reduce integration friction.

“ship v2 of our API, which did mirror OpenAI's API specs.”article, stated

Tradeoffs

Build a gateway instead of banning LLM use

Chose Controlled internal gateway over Employee ban on ChatGPT-style tools.

Rationale: The gateway preserved exploration and productivity while adding audit and privacy controls.

“we built a gateway that would address security and privacy concerns while also providing the freedom to explore.”article, stated

Self-host open-source LLMs for sensitive data

Chose llama.cpp-backed self-hosted models over Redacting all data before external provider calls.

Rationale: Self-hosting preserved unredacted context for legitimate workflows while keeping data inside Wealthsimple's cloud.

“we started to look into self-hosting open source LLMs.”article, stated
“a quantized framework for self-hosting open-source LLMs.”article, stated

Adopt OpenAI-compatible API standards

Chose OpenAI API compatibility over A custom internal API structure.

Rationale: Compatibility reduced headaches integrating with LangChain and maturing GenAI tooling.

“Because OpenAI's API specs became the gold standard, we ran into a lot of headaches with integrations.”article, stated
“it's important to think about what the right standards and integrations are.”article, stated

Gotchas (what bit them)

Audit trails alone did not prevent data leakage.

Root cause: The first gateway tracked outbound data but had few guardrails preventing sensitive data from being shared externally.

Resolution: Wealthsimple added a PII redaction model and self-hosted LLM paths.

“the first iteration of our LLM gateway had a great paper trail, it offered very few guardrails and mechanisms to prevent data from being shared externally.”article, stated
“the next thing we shipped in June of 2023 was our own PII redaction model”article, stated

PII redaction hurt answer relevance for legitimate work.

Root cause: The model was not always accurate and employees sometimes needed the original sensitive data.

Resolution: Wealthsimple introduced self-hosted open-source LLMs so sensitive data could stay in its cloud environments.

“PII redaction model was not always accurate, which often interfered with the relevancy of the answers provided.”article, stated
“For self-hosted LLMs, we didn't have to run the PII redaction model.”article, stated

A non-standard gateway API created integration rework.

Root cause: The initial internal API did not mirror the de facto OpenAI API standard.

Resolution: Wealthsimple shipped a v2 API that mirrored OpenAI's specs.

“We had to rewrite a lot of code from LangChain and other libraries and frameworks because we didn't offer a compatible API structure.”article, stated
“ship v2 of our API, which did mirror OpenAI's API specs.”article, stated

Two separate assistant surfaces damaged adoption.

Root cause: Employees had multiple places to satisfy GenAI needs, splitting attention and usage.

Resolution: Wealthsimple unshipped/combined earlier tool approaches as its platform matured.

“we had actually created two different places for people to get their GenAI needs. That was detrimental for both adoption and productivity.”article, stated

Evaluation

Wealthsimple used adoption, message volume, weekly/monthly active users, surveys, client interviews, and production promotion of data applications as practical evaluation signals for GenAI productivity.

Metrics: over 2,200 daily messages · weekly active users close to one-third of company · monthly active users slightly over half of company · over seven applications in first two weeks · two applications reaching production · productivity survey/interview feedback

3 supporting quotes
“over 2200 messages are sent daily. Close to a third of the entire company are weekly active users.”article, stated
“Slightly over half of the company are monthly active users.”article, stated
“In the surveys and the client interviews we did, almost everyone who used LLMs found that they significantly increased or improved their productivity.”article, stated

Outcomes

The source describes a 2023-2024 platform journey with gateway, redaction, self-hosted models, RAG API, data apps, multimodal inputs, and OpenAI-compatible API v2.

3 supporting quotes
“Wealthsimple really loves LLMs. Across all the different tools we offer, over 2200 messages are sent daily.”article, stated
“Close to a third of the entire company are weekly active users. Slightly over half of the company are monthly active users.”article, stated
“These internal tools establish the building blocks to build and develop GenAI at scale”article, stated