How Google’s Open Models are empowering the Pharmaceutical industry to build secure, “Zero-Compromise” AI solutions.
In my 22 years in the technology sector, I have witnessed several waves of innovation. But the current era of Generative AI brings a unique challenge, especially for highly regulated sectors like Pharmaceuticals: The Security vs. Innovation Gap.
As a Google Developer Expert (GDE) in AI, I am a firm believer in the power of Google Cloud’s Vertex AI for enterprise-scale intelligence. However, during a recent collaboration with a Pharma giant, I encountered a specific hurdle. Their research teams were sitting on “Gold Standard” data — proprietary drug formulas, vendor KPIs, and sensitive procurement research.
Because of strict data sovereignty policies, they were manually “masking” data before using any cloud-based Copilots. This was not just time-consuming; it was stripping the AI of the very context it needed to provide meaningful insights.
My message to them was clear: Stop compromising your data for AI. Bring the AI to your data.
The Solution: A Privacy-First “Personal AI” for Pharma
The beauty of Google’s AI strategy lies in its versatility. While Vertex AI is the powerhouse for the cloud, Gemma — Google’s open-weight model — is the perfect athlete for the edge.
For this project, I architected a “Personal AI” dashboard that lives entirely within the corporate firewall. By leveraging Gemma 3, we can perform structured business analysis locally, ensuring that sensitive drug trial results or procurement costs never touch the public internet.
Tutorial: Building the “Talk-to-Data” Dashboard
To prove how accessible “Zero-Compromise” AI is, I developed a proof-of-concept using Streamlit, Ollama, and Gemma 3. This application takes a raw CSV, analyses its schema, and builds a dynamic BI dashboard locally.
Prerequisites
- Install Ollama.
- Pull the model: ollama run gemma3:4b.
- Install Python requirements: pip install streamlit pandas ollama.
The Core Logic
The following code allows a user to upload sensitive Pharma data. The AI acts as a Senior Business Analyst, returning a structured JSON that defines the business domain, KPIs, and even the chart configurations.
import streamlit as st
import pandas as pd
import json
import ollama
import re
# ---------------- CONFIG ----------------
st.set_page_config(page_title="AI Business Dashboard", layout="wide")
st.title(" AI Business Dashboard (Gemma 3 – Business Analyst)")
# ---------------- HELPERS ----------------
def preprocess_data(df):
summary = {
"rows": len(df),
"columns": list(df.columns),
"numeric": df.select_dtypes(include="number").columns.tolist(),
"categorical": df.select_dtypes(exclude="number").columns.tolist(),
"missing": df.isnull().sum().to_dict()
}
return summary
def safe_json_parse(text):
if not text or text.strip() == "":
return None
try:
return json.loads(text)
except:
pass
match = re.search(r"{.*}", text, re.DOTALL)
if match:
try:
return json.loads(match.group())
except:
return None
return None
def calculate_kpi(kpi_name, df):
name = kpi_name.lower()
numeric_cols = df.select_dtypes(include="number").columns
if "revenue" in name or "sales" in name:
for col in numeric_cols:
if any(x in col.lower() for x in ["revenue", "sales", "amount"]):
return f"{df.sum():,.0f}"
return "N/A"
def gemma_business_analysis(profile, df):
sample = df.head(5).to_dict()
prompt = f"""
You are a senior business analyst and BI consultant.
Dataset profile:
Rows: {profile['rows']} | Columns: {profile['columns']}
Tasks:
1. Identify business domain
2. List 4–6 important KPIs
3. Recommend charts for a dashboard
4. Write clear business insights
Return STRICT JSON format.
"""
response = ollama.chat(
model="gemma3:4b",
messages=[{"role": "user", "content": prompt}]
)
raw_output = response["message"]["content"]
parsed = safe_json_parse(raw_output)
return parsed if parsed else {}
def render_charts(charts, df):
rendered = 0
for chart in charts:
x, y = chart.get("x"), chart.get("y")
if x in df.columns and y in df.columns:
if chart["type"] == "bar":
st.bar_chart(df.groupby(x)[y].sum())
rendered += 1
elif chart["type"] == "line":
st.line_chart(df.groupby(x)[y].sum())
rendered += 1
return rendered
# ---------------- UI ----------------
uploaded_file = st.file_uploader("📁 Upload your business CSV file", type=["csv"])
if uploaded_file:
df = pd.read_csv(uploaded_file, encoding="latin-1")
st.subheader("🔍 Data Preview")
st.dataframe(df.head())
profile = preprocess_data(df)
if st.button(" Generate Business Dashboard"):
with st.spinner("Gemma is analyzing your business data..."):
result = gemma_business_analysis(profile, df)
st.subheader(" Business Domain")
st.write(result.get("domain", "Unknown"))
st.markdown("## 📈 Key Business KPIs")
kpis = result.get("kpis", [])
cols = st.columns(len(kpis) if kpis else 1)
for i, kpi in enumerate(kpis):
value = calculate_kpi(kpi, df)
cols[i].metric(kpi, value)
st.subheader("📊 Dashboard Visuals")
render_charts(result.get("charts", []), df)
st.subheader(" Business Insights")
for insight in result.get("insights", []):
st.write("•", insight)
https://medium.com/media/eca6a64a35c513c3190b2994cfbcfbc0/href

Scaling Local Intelligence
This setup is the first step toward a Hybrid AI Strategy. While we keep the data processing local for maximum privacy, the architecture is designed for future scaling:
- FastAPI Integration: Transitioning to a FastAPI backend allows this local dashboard to serve multiple departments over a secure internal network.
- Containerization: Packaging this stack into Docker containers ensures that the IT team can deploy “Personal AI” nodes across private GPU clusters.
- Local AutoML: My future vision involves integrating AutoML capabilities directly into this local environment, allowing Pharma teams to predict drug shelf-life or supply chain risks without a single byte ever touching the public internet.
Conclusion
In 2026, the success of AI in specialised industries like Pharma depends on Flexibility. By using Google’s Gemma, we are proving that you don’t have to choose between cutting-edge innovation and absolute data privacy.
You can have both.
About the Author: Geeta Kakrani is a Google Developer Expert (GDE) in AI with over 22 years of experience. She specialises in LLMs, Agentic AI, and helping enterprises navigate the complexities of secure AI implementation.
Personal AI in Pharma: Keeping Your Data Private with Zero Compromise using Google Gemma was originally published in Google Developer Experts on Medium, where people are continuing the conversation by highlighting and responding to this story.