<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rohith Leeladharan on Medium]]></title>
        <description><![CDATA[Stories by Rohith Leeladharan on Medium]]></description>
        <link>https://medium.com/@rohith.leeladharan?source=rss-16c4e8d309a8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*a3UmMhv3XiakQIEbNdKpZA.jpeg</url>
            <title>Stories by Rohith Leeladharan on Medium</title>
            <link>https://medium.com/@rohith.leeladharan?source=rss-16c4e8d309a8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 22:31:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rohith.leeladharan/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Creating an AI Platform for classic ML online inference]]></title>
            <link>https://medium.com/amex-gbt-technology/creating-an-ai-platform-for-classic-ml-online-inference-e2165d68e18a?source=rss-16c4e8d309a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2165d68e18a</guid>
            <category><![CDATA[mlops]]></category>
            <category><![CDATA[ai-platform]]></category>
            <category><![CDATA[ai-platform-engineering]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Rohith Leeladharan]]></dc:creator>
            <pubDate>Thu, 10 Sep 2026 07:26:45 GMT</pubDate>
            <atom:updated>2026-09-10T07:28:21.505Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>In 2021, we were given the mission to have AI Systems running in production. The team, instead of just following a classical MLOps process, that involves transforming a Jupyter notebook into a product running in production, decided to go further by creating a platform to deploy AI systems in production. The team decided the platform should respect these requirements:</p><ul><li><strong>Simplicity:</strong> The code powering AI systems should be simple, readable, and easy to maintain — less intricacy means fewer bugs in production and greater reliability.</li><li><strong>Self-service:</strong> Anyone should be able to build and deploy AI systems autonomously, without depending on a central team.</li><li><strong>Experimentation:</strong> The platform should make it easy to run and iterate on experiments.</li><li><strong>Continuous improvement:</strong> Data related to events and interactions within AI systems must be captured, enabling monitoring and continuous improvement over time.</li></ul><p>In this article, we will walk through the work done to build a platform that fulfills these four requirements.</p><h4>Background</h4><p>At American Express Global Business Travel, we use machine learning (ML) models for a variety of user experiences like ranking hotel and flight search results. Our ML models are wrapped in inference engines that handle both pre-processing of input data before we run a prediction with the model, and post-processing of output data before returning the output to the caller. The overall flow looks something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PqW_gKkayZ4KgigipfE6pA.png" /><figcaption>Figure 1: Handling an inference request</figcaption></figure><p>A client service that would like the ML model’s predictions provides necessary context about the request like which user the request is for. Then, optionally, the inference engine fetches any necessary features for inference from our feature store [<a href="https://medium.com/amex-gbt-technology/serving-features-efficiently-for-online-inference-with-fast-feature-store-part-1-8992fdce2eb4">part 1</a>][<a href="https://medium.com/amex-gbt-technology/serving-features-efficiently-for-online-inference-with-fast-feature-store-5a1f26c61e8a">part 2</a>]. Finally, it pre-processes the data, runs the predictions using the trained ML model, and does any necessary post-processing of the model output before returning the response to the caller. We call this the pre-process, predict, post-process pattern (PPP pattern).</p><p>For example, if the hotel search service wants a model to rank hotel search results, it passes in metadata about the user and the hotels it likes the model to rank. Then, the inference engine fetches additional, pre-computed features necessary for ML inference like the popularity of each hotel at that user’s company. After that, it processes all input features, runs the prediction with the ML model, and returns the processed output back to hotel search service.</p><h3>Simplicity</h3><p>Since a majority of our ML use-cases follow the above structure, we aimed to make the development process as simple as possible. We provide an inference engine template that handles much of the boilerplate to encapsulate an ML model in a production-ready deployment. Part of that is our InferenceApp abstraction, provided in our internal library, that wraps the inference engine in an extensible FastAPI application that handles things like authentication, contextualizing logs, and downloading model files on application startup. Both these tools enable our machine learning engineers to iterate quickly in taking a model from experimentation and training to production.</p><h3>Self-service</h3><p>The platform was designed with a self-service mindset. This means that users of the platform (ML engineers and developers alike) aren’t only responsible for training a model in a notebook, but for delivering a fully production-ready inference engine powered by that model.</p><p>The team developed a set of tools enabling users to deploy inference engines autonomously. <a href="https://medium.com/amex-gbt-technology/transforming-our-costs-migrating-our-ml-model-serving-infrastructure-from-aws-sagemaker-to-f17864713a42">This article</a> provides more details.</p><p>Beyond providing tooling, we believe that a successful self-service platform also requires training users, maintaining good documentation, and actively gathering their feedback.</p><p>We provide extensive documentation covering high-level architecture, architectural decision records, user guides, and tutorials. The team also runs hands-on workshops and holds two weekly office hours sessions to present new features, gather feedback, and support the teams using the platform.</p><h3>Experimentation</h3><p>Clients never call inference engines directly. Instead, clients requesting predictions from our ML models go through online-inference-service (OIS). OIS enhances each incoming request and routes it to the correct inference engine.</p><p>OIS supports three modes of experimentation: A/B testing, shadow testing, and customized testing for a specific subset of users.</p><p>In the case of A/B testing, requests are routed to the right inference engine depending on the id of the user that is connected. In the case of shadow testing, requests are routed to the live inference engine but also to the shadow inference engines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*oi8699PFT-_XRzOha3tt6Q.png" /><figcaption>Figure 2: A/B testing and shadow testing of models via OIS</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*GEOSlg2BjCYr5F91AClGvg.png" /><figcaption>Figure 3: Routing by user location via OIS</figcaption></figure><p>Running models within inference engines gives data scientists greater freedom to experiment. This is because many features can be pre-computed and stored in the feature store, then retrieved during the pre-processing step of the inference engine.</p><p>However, some features are not available in the feature store. For example, the price of flights or the cabin class. Yet data scientists still want to maintain their freedom to experiment without waiting for clients to provide newly required features. To address this, data scientists often deliberately require additional features when defining their APIs, even if those features are not needed by the model they are currently deploying. This way, new features can be introduced later without requiring clients to update their code. To assess the performance impact of this approach, we benchmarked the effect of including unused features on inference latency. Testing with 20 unused features, the overhead was less than 1ms on response time — acceptable given our business requirements.</p><p>Let’s consider the following example:</p><p>A data scientist decides to expose only two parameters in their Flight Ranking Inference Engine: for each flight, its price and the airline. The first version of the model (v1) uses two features: the flight price and the airline rating.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*txAzFdfj-1YeW2bqUf1ujQ.png" /><figcaption>Figure 4: First version of the model requiring only flight_price and airline_rating. Airline ratings are precomputed and stored within the feature store.</figcaption></figure><p>So far so good. There is a feature group called “airline” in the feature store, which contains a feature called “rating” — corresponding to the airline_rating feature in the model. Since the airline is passed in the request, its rating can be retrieved from the feature store. The flight price is also passed in the request and therefore can be fed directly to the model.</p><p>Now, the data scientist decides to add a new feature to the model called “airline_average_delay”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3FWjLTLhw7Ml2PYNfhFFOw.png" /><figcaption>Figure 5: Second version of the model that additionally requires airline_avg_delay. Since this feature can be precomputed, it’s added to the feature store and no change is required to the inference API.</figcaption></figure><p>In this case, “average_delay” is added by the data scientist to the feature store (assuming this information is available, such as in a data lake), so there’s no need to change the API contract.</p><p>For the third version of the model, a new feature called “cabin_class” is added:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4L7LhjWIAJx56guw0QCr7Q.png" /><figcaption>Figure 6: Third version of the model additionally requires cabin_class as input. This feature cannot be precomputed as it’s based on the user’s flight search query, so this would require a change to the inference API.</figcaption></figure><p>Cabin class, like flight price, is a feature that is only available in real-time and cannot be pre-cached, meaning the client must pass this information directly to the inference engine. Requiring clients to provide only the features a model currently needs would slow down experimentation, so it’s common practice to request all candidate features anticipated for future models, rather than just the bare minimum.</p><h3>Continuous improvement</h3><p>Continuously improving our AI systems and detecting data drift requires a robust data capture strategy.</p><p>In our platform, online-inference-service (OIS) automatically captures all requests and responses to and from every inference engine. Data capture is done in asynchronous threads and doesn’t impact user experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*uGPLXi9pgmjLuaL8yMkoqg.png" /><figcaption>Figure 7: Capturing all model requests and responses in OIS using Kinesis Data Streams. The captured data will be used to improve the model over time.</figcaption></figure><h3>Conclusion</h3><p>With self-service development and deployment, data scientists have become significantly more agile, enabling them to experiment at a much greater pace.</p><p>It hasn’t always been smooth sailing. Our first inference engines suffered from very high response times. The first version of our Flight Ranking AI System deployed in staging took over 60 seconds to respond. However, the willingness of data scientists to learn and improve, combined with proper training, helped us overcome the various roadblocks we encountered along the way.</p><p>As of September 2026, we have 21 inference engines following the PPP pattern across 11 different projects. For instance, the Flight Ranking AI System alone runs multiple inference engines, handling millions of requests per week in production. The simplicity of this pattern has allowed us to maintain an error rate as low as 0.01%.</p><h4>We have many ideas on how to improve our platform</h4><ul><li><strong>Inference on events:</strong> We want to provide tooling that enables inference engines to consume events (from a kafka stream for example), run them through the PPP pipeline, and pass the results to a downstream system that can react accordingly. A practical example would be a model that predicts what a user is about to do on our website, triggering pre-emptive processing to deliver a smoother experience.</li><li><strong>Extend the monitoring capabilities of OIS:</strong> Improve data drift detection across all models in a standardized way, minimizing the need for bespoke work on a per-model basis.</li><li><strong>Accelerate the creation of inference engines: </strong>Develop agent skills so that the code for the first version of an inference engine can be generated with the assistance of AI coding agents.</li><li><strong>Composable PPP pipelines:</strong> Introduce support for orchestrators that can coordinate inference across multiple inference engines, running them in parallel or sequentially, enabling the composition of more sophisticated AI systems.</li><li><strong>Reduced coupling between models and inference engine code:</strong> Deploy models in standalone Kubernetes pods, each exposing an API, so that the prediction code in the inference engine doesn’t need to change when a model retains the same features but switches to a different type, for example, migrating from a random forest to a neural network. This approach also allows models requiring GPUs to run on dedicated instances, without requiring the entire PPP pipeline to run on GPU nodes.</li><li><strong>Support for other types of experimentation:</strong> We want to add support for canary testing.</li></ul><p>The journey from a single Jupyter notebook to a platform handling millions of requests per week is a testament to what’s possible when simplicity, autonomy, and a culture of continuous learning are built into the foundation from day one. What started as a mission to get AI systems running in production became something far greater — a platform that continues to evolve, improve, and inspire what comes next.</p><p><em>This article represents the personal perspectives of the author and should not be considered an official statement, endorsement, or position of GBT or its affiliates.</em></p><p><em>American Express and certain associated logos are trademarks of American Express, used in approved formats by GBT Travel Services UK Limited and its authorized sublicensees pursuant to a limited license. American Express holds a minority interest in Global Business Travel Group, Inc. (NYSE: GBTG), which operates as a separate company from American Express.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2165d68e18a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/amex-gbt-technology/creating-an-ai-platform-for-classic-ml-online-inference-e2165d68e18a">Creating an AI Platform for classic ML online inference</a> was originally published in <a href="https://medium.com/amex-gbt-technology">Amex GBT technology</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Transforming our costs: Migrating our ML model serving infrastructure from AWS SageMaker to…]]></title>
            <link>https://medium.com/amex-gbt-technology/transforming-our-costs-migrating-our-ml-model-serving-infrastructure-from-aws-sagemaker-to-f17864713a42?source=rss-16c4e8d309a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/f17864713a42</guid>
            <category><![CDATA[ai-platform]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai-operations]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Rohith Leeladharan]]></dc:creator>
            <pubDate>Wed, 26 Nov 2025 09:20:31 GMT</pubDate>
            <atom:updated>2025-11-26T09:20:31.902Z</atom:updated>
            <content:encoded><![CDATA[<h3>Transforming our costs: Migrating our ML model serving infrastructure from AWS SageMaker to Kubernetes</h3><p>At Amex GBT Egencia (Egencia), we’re committed to optimizing our technology to deliver the best travel solutions. Our recent migration of machine learning models, from Amazon SageMaker to Amazon Elastic Kubernetes Service (EKS) represents a strategic leap in technological innovation.</p><p>This article explores our journey of transforming our AI infrastructure to enhance performance, reduce costs, and ultimately provide a superior customer experience.</p><h3><strong>Machine learning at scale: Our SageMaker journey</strong></h3><p>To optimize the shopping experience for our customers, we leverage several machine learning (ML) models across the organization. These models are wrapped in our inference engines which contain additional code to pre-process input data and post-process the model output before sending the response to the caller.</p><figure><img alt="Components of an inference engine: pre-processing, prediction, post-processing" src="https://cdn-images-1.medium.com/max/700/1*SrTNECyXufg5SiHykgWIqA.png" /><figcaption>Components of an inference engine</figcaption></figure><p>So far, we’ve been using Amazon SageMaker to serve our models and run online inference at scale. Amazon SageMaker has provided us with many benefits such as:</p><ul><li>A generic container image that works for a variety of ML models optimized for inference on AWS hardware.</li><li>Simplifying the infrastructure the models run on, like managing node groups on AWS.</li></ul><p>However, it wasn’t always fun and games. We experienced multiple issues with serving our models via SageMaker:</p><ul><li>Whenever an endpoint crashed, it was difficult to restart the instances on SageMaker. We’d have to deploy a brand-new endpoint and reconfigure our systems to route traffic to the new one.</li><li>Any CVEs reported by our security team were difficult to patch immediately as we did not control the container images the models ran on.</li><li>It was quite expensive. SageMaker instances are generally more expensive than running pods on Kubernetes, and there was no autoscaling by default which wasn’t ideal for cost optimization.</li><li>The SageMaker image we were using to run our models didn’t have support for asynchronous execution of our models and API calls that we made during inference, which hindered performance.</li></ul><p>Due to these issues, and the fact that all other Egencia™ services run on Kubernetes, we decided to migrate our ML serving infrastructure from Amazon SageMaker to Amazon Elastic Kubernetes Service (EKS). While we considered various Kubernetes-native ML serving frameworks like KServe and Seldon Core, we decided to go with a more bare-bones solution so we could have maximum control over our serving infrastructure.</p><h3>How we did it</h3><p>Before models could be deployed to Kubernetes, we first needed to wrap them in a service. We decided to go with FastAPI as it’s the de-facto ASGI web serving framework in Python. We built an abstraction in our internal Python library called InferenceApp that would wrap our inference engines in a FastAPI application and handle things like contextualizing logs and downloading the model file from our registry on application startup.</p><figure><img alt="Inference engines were wrapped in a FastAPI server, with the inference code available at the /predict endpoint" src="https://cdn-images-1.medium.com/max/771/1*WadAkbJNbFVgTJnmF-9gCw.png" /><figcaption>Components of our model server</figcaption></figure><p>Then, we packaged our FastAPI-wrapped inference engines in a Docker image that was configured to integrate with Datadog for logging and application performance monitoring.</p><p>Finally, to standardize deployments to Kubernetes, we built several pieces of infrastructure:</p><ul><li>Helm charts for model deployments. These charts contained templates for various Kubernetes resources needed for a production-ready deployment including ingress controllers and pod disruption budgets.</li><li>A command line tool to standardize inference engine builds and deployments in an auditable, reproducible manner.</li><li>A standardized Jenkins pipeline to deploy inference engines to Kubernetes using the commands from the tool above.</li></ul><p>Putting those pieces together, we ended up with a deployment pipeline that looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jWZtz1Xqc68tls7uChlRyw.png" /><figcaption>High-level diagram of the final deployment pipeline</figcaption></figure><p>Once we started migrating our inference engines to run on Kubernetes, we wanted to make sure the infrastructure changes didn’t have a negative impact on performance. To do this we had a staged testing and rollout strategy:</p><ol><li>For a variety of sample requests pulled from production, we made sure the response from the inference engine on SageMaker and the response from the inference engine on Kubernetes were the same.</li><li>In our lab environment, we load tested the SageMaker endpoint and the Kubernetes endpoint using sample request data pulled from production. We compared request success rates and response times to make sure the inference engines on Kubernetes performed similarly, if not better, than the SageMaker endpoints under peak production loads.</li><li>Once offline performance evaluation was complete, we routed shadow traffic to the inference engines on Kubernetes in production using our internal inference service. This way, we could see how the inference engines perform in real time without our end users seeing any drop in performance.</li><li>Once all the bugs were flushed out, and the model seemed to be performing well in shadow traffic, we switched it to receive live traffic in production.</li></ol><p>This phased rollout strategy wouldn’t have been possible without our online inference service. It handles the automatic data capture of requests and responses, sending shadow traffic to models for online evaluation, A/B testing models, and much more. See below for a diagram of how our online inference service works:</p><figure><img alt="Diagram of how our online inference service works. It’s complete with features like A/B testing models, capturing requests and responses, and sending shadow traffic to models." src="https://cdn-images-1.medium.com/max/1024/1*SnWVNEROYNB-zH7MhpDIlg.png" /><figcaption>High-level diagram of our online inference service</figcaption></figure><h3>Challenges</h3><h4>Templates vs library approach for model serving</h4><p>For SageMaker deployments, we templated the entry point file that contained definitions for the common SageMaker functions like model_fn, input_fn, predict_fn(<a href="https://github.com/aws/sagemaker-scikit-learn-container/blob/master/src/sagemaker_sklearn_container/serving.py">SageMaker container code</a>). This was possible thanks to each of our inference engines following the same entry point pattern.</p><p>To follow those conventions, we tried to template the FastAPI serving file and the Dockerfile to minimize the changes required to migrate. However, we encountered issues with dependency resolution. In general, on the AI Platform team, we like to design our systems to be flexible with defaults. That way, our AI engineers can rely on the defaults whenever possible but still have the flexibility to implement custom features when needed.</p><p>As a result of the dependency conflicts, we decided to go with a library approach for model serving. In our internal Python library, we built the InferenceApp abstraction that easily wraps our inference engines in a FastAPI application.</p><h4>Making the migration easy as possible</h4><p>As with any migration, a key bottleneck is adoption by the various teams owning the services to be migrated. So, to increase adoption, we aimed to make the migration as easy as possible.</p><p>Inference engines on SageMaker all followed similar semantics such as having a consistent entry point into the prediction pipeline and being able to run on the same SageMaker container image. We leveraged those semantics to make migration as easy as possible. The InferenceApp abstraction was designed to allow our AI Engineers to spin up their model as a service with just a few lines of code.</p><p>In addition, most of the code changes required to migrate an inference engine to Kubernetes were mostly copy-paste. This enabled easy-to-use defaults, but still gave our AI Engineers flexibility to implement custom adjustments when needed.</p><h4>Multi-versioned inference engines</h4><p>New versions of a model — which include changes to the inference engine code as well, are A/B tested via our online inference service before servicing 100% of production traffic (as depicted in the diagram above). Therefore, we needed to allow multiple versions of an inference engine to run simultaneously in the same Kubernetes cluster. However, that was generally unsupported by the existing infrastructure within our organization.</p><p>Subsequently, we built custom Helm charts that supported versioned deployments. Different versions of an application would get independent Kubernetes resources (deployment resources, service resources, ingress resources, etc.). That way, multiple versions of the same inference engine could co-exist in the same Kubernetes namespace.</p><p>However, this presented challenges with integrating with our role-based access control systems like Vault. Running different “flavors” of an application within the same Kubernetes cluster did not fit neatly with how Vault Roles were configured. To solve this issue, we had to decouple service account provisioning from the Helm charts used to provision the other Kubernetes resources.</p><h3>Impact and outcomes</h3><p>From a developer perspective, migrating our inference engines to Kubernetes had many benefits. It has:</p><ul><li>Provided better integration with Datadog for logging and monitoring.</li><li>Made it easier to maintain with Helm for updates, rollbacks, and restarts.</li><li>Made it easier to mitigate CVEs since we build our own images and control all aspects of the tech stack.</li><li>Enabled us to use our proprietary libraries within our inference engines.</li><li>Allowed us to integrate with other services running on our Kubernetes clusters.</li><li>Enabled us to quickly adopt latest developments in the AI/ML and Python world.</li></ul><p>In addition to these benefits, migrating to Kubernetes for our model serving infrastructure has great cost-savings benefits:</p><ul><li>Running pods on Kubernetes is generally cheaper than paying for full SageMaker instances.</li><li>We can automatically scale model pods on Kubernetes based on traffic; we only pay for what we use.</li></ul><p>Before the migration, we estimated that we’d reduce our costs by around 26% by migrating from SageMaker to EKS. But in reality, we saved much more. For just one of our inference engines, we were able to reduce operating costs by 66%!</p><p>We learned a lot in this migration and will leverage the infrastructure change in further developing the AI Platform at American Express Global Business Travel. The transition to Kubernetes enables us to meticulously track and monitor our inference engine performance at a more granular level than ever before, and we plan to leverage this in improving AI observability in the organization. In addition, this transition enables our AI Engineers to innovate and iterate faster in the AI/ML space to deliver more value to our customers while reducing our operating costs for the business.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f17864713a42" width="1" height="1" alt=""><hr><p><a href="https://medium.com/amex-gbt-technology/transforming-our-costs-migrating-our-ml-model-serving-infrastructure-from-aws-sagemaker-to-f17864713a42">Transforming our costs: Migrating our ML model serving infrastructure from AWS SageMaker to…</a> was originally published in <a href="https://medium.com/amex-gbt-technology">Amex GBT technology</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>