Generative AI with Guardrails: safety, security and compliance through hybrid cloud architectures
In autumn 2024 I gave a talk on running generative AI with guardrails: at Sphere.it Connect: ML Engineering in Kraków on 24 October, and, together with Marcin Abram, at Data Science Summit Online on 21 November. This post is a written version of it. The slides are available as PDFs: Sphere.it Connect and Data Science Summit .
The problem
The usual generative AI application architecture, for example IBM’s hybrid RAG reference architecture, calls a model that is offered as a third-party service. For many organisations that is exactly the part that has to move into their own environment. The talk asks what that takes, and splits the answer into three parts:
- the model,
- the private deployment of the model,
- the safety, security and compliance controls around it.
1. The model
Choosing a model starts with what you are allowed to do with it, and what you can find out about it.
- Licence. All IBM Granite models are released under the permissive Apache 2.0 licence.
- Training data. IBM discloses the training datasets and methodologies for Granite 3.0 in its technical paper. The governance process behind them includes curated data collection, data clearance, licence verification, URL filtering, transparency and documentation.
- Characteristics. Purpose and performance of the model decide whether it fits the use case.
Once a model is chosen there are four ways to adapt it to a use case:
- Retrieval-augmented generation (RAG) combines a pre-trained model with knowledge retrieval.
- In-context learning relies on the model producing suitable answers from the context in the input.
- Fine-tuning adapts the pre-trained model to a specific use case (InstructLab is one way to do it).
- Prompt engineering (prompt tuning) shapes the prompts that are submitted to a deployed foundation model.
2. The private model deployment
The question for this part is how to use generative AI models without third-party services.
- On a laptop. Ollama runs a model locally with one command, for example
ollama run granite3-dense:8b. The same approach gives a private code assistant: a Granite Code model, Visual Studio Code as the IDE and Ollama as the model server. - At scale. The example scenario deploys watsonx.ai on premises or on a private cloud, on Red Hat OpenShift and IBM Cloud Pak for Data, which can run on premises or on any vendor’s cloud. vLLM serves the large language models. watsonx also offers LLMs through an API as SaaS, but that was not the use case of the talk. The Sphere.it version also covered hardware requirements.
3. Safety, security and compliance
A privately deployed model still needs controls around it.
- Filtering and guarding model input and output. HAP (hate, abuse, profanity) language filtering and the Granite Guardian model.
- A framework for adoption. The Generative AI Controls Framework whitepaper describes a safe, secure and compliant approach to AI adoption.
- Fairness and governance tooling. AI Fairness 360 (open source), IBM OpenPages and watsonx.governance.
- Regulation. Be ready for the EU AI Act.
The closing checklist
The talk ends with one slide that lists everything above:
- licence of the model and of the training dataset (see Granite), and the model’s characteristics, purpose and performance;
- customisation options: RAG architecture, fine-tuning, prompt tuning and in-context learning;
- interacting with LLMs on a local machine (Ollama), a private code assistant (Visual Studio Code with Granite), and private LLM deployments at scale (Cloud Pak for Data, vLLM);
- HAP language filtering and the Granite Guardian model;
- the Generative AI Controls Framework, AI Fairness 360, IBM OpenPages and watsonx.governance;
- compliance with the EU AI Act.