Structured GenAI at Scale

01 Apr 2025

Discover how we built a robust, reusable AI framework that powers scalable GenAI projects across an entire pharma organization.

Challenge

A leading pharmaceutical company needed a scalable, future-proof framework to support the rollout of multiple AI projects. Their main challenge was to build a consistent foundation that could automate and enhance various business processes, while ensuring reliability, reusability, and interoperability across different use cases.

They were looking for a solution that would reduce duplicated effort, accelerate project delivery, and maintain high standards for output quality, especially in critical contexts where LLMs are involved.

Solution

We developed a generic, reusable AI framework, specifically designed to support the pharma client’s future GenAI initiatives.

At its core is a LLM-minded API framework for Python, optimized for structured, validated, and reliable language model integration. Key features include:

  • Structured LLM output using Pydantic models and dataclasses, enabling clean integration between LLM reasoning and business logic

  • Validation-first architecture, where each LLM response is automatically checked and improved upon if it doesn’t meet defined criteria

  • Support for both closed-source and locally hosted models, ensuring adaptability to providers like OpenAI and Google, or internal deployments

  • Scalable, production-grade API deployment, built on FastAPI for high concurrency and seamless integration with external services

  • Rate limit handling, integrated at the component level, making the framework robust in real-world, high-volume environments

  • Engineered components to complement LLMs, reducing hallucinations by blending generative output with structured, rule-based validation

In addition, we packaged several ready-to-use components, such as a table interrogator, multi-agent system, translator, content tagger, and evidence generator, designed for reuse across projects.

Result

The result is a unified, robust platform that standardizes how AI capabilities are developed, validated, and deployed within the organization.

This framework significantly improves efficiency, maintainability, and reliability across AI projects. It allows new solutions to be built faster, with less overhead and greater confidence in quality.

By combining the flexibility of LLMs with solid engineering practices, the framework enables the customer to scale GenAI adoption across domains, from internal automation to external-facing solutions, all while maintaining control and consistency.

Let's connect!

© 2025 Common Sense AI. All rights reserved.

Member of

Veldkant 7, 2550 Kontich

+32477346313 (Matthias)

+32470105014 (Jean-Joseph)

info@common-sense-ai.be

Let's connect!

© 2025 Common Sense AI. All rights reserved.

Member of

Veldkant 7, 2550 Kontich

+32477346313 (Matthias)

+32470105014 (Jean-Joseph)

info@common-sense-ai.be