SAS Model Manager has been a centralized repository for governing analytical models, regardless of whether they are built in SAS, Python, or R. However, operationalizing open-source models at scale, scoring millions of records, often introduced friction. Historically, data had to move from high-performance storage into a Python environment, be processed, and then moved back. This data movement was often the bottleneck.
Enter CAS Gateway, a feature enhancement introduced in SAS Viya Long-Term Support (LTS) releases 2024.09 and leveraged by SAS Model Manager in 2025.01. It fundamentally shifts how Python and R models execute within the SAS ecosystem, moving from a centralized execution model to a distributed, parallel processing model.
In this three-part series, we will unpack this technology:
To understand the value of CAS Gateway, we first need to look at the architecture prior to the 2025.01 release for scoring open-source models in SAS Viya, often referred to as PyMAS (Python Micro Analytic Service).
In the PyMAS approach:
While excellent for real-time transactions (for example scoring one loan application at a time), this architecture struggles with batch jobs involving multi-millions of rows. The overhead of serialization and the single-threaded nature of standard Python interpreters create a “soda straw” effect, forcing a massive lake of data through a tiny pipe.
Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.
Starting with the 2025.01 stable release, SAS Model Manager adopted the CAS Gateway action set for performance monitoring and scoring tests of Python models.
The concept is simple but powerful: Bring the code execution to the data.
By doing so, CAS Gateway avoids the per-row marshalling and serialization overhead that limits the traditional PyMAS flow, making it a much better fit for high-volume batch scoring.
Instead of moving data out of CAS to a Python process, CAS Gateway can spin up a Python interpreter on each CAS worker node directly.
The impact of this architectural shift is dramatic. In internal benchmarks and community reports, users have seen consistent, often substantial speedups, commonly multiple-fold reductions in execution time, though exact gains vary by model, data size, and cluster configuration; some isolated tests have shown larger reductions for specific workloads.
Here are some data points to highlight that explain the shift: At 35.8K records, the pre-2025.01 method takes 184 seconds whilst post-2025.01 it takes just under 9 seconds. Scoring 17.9 million records takes 75 seconds whereas a pre-2025.01 would have taken 10+ minutes.
Note: this diagram and the example numbers were derived from the SAS® Model Manager: Quick Start Tutorial and, more specifically, the “Evaluate and Deploy a Python Model” exercise in that tutorial. For transparency, the chart omits pre-2025.01 results beyond ~71k rows because the earlier release exhibited a flattening of benefits at larger sizes that would compress the visual differences; reported speedups therefore depend on model, data shape, and cluster configuration.
For an IT persona, this means:
This high-level overview explains why the CAS Gateway is a game-changer for open-source integration in SAS Viya. In Part 2, we will look at how SAS Model Manager exposes this feature. We will see how it intelligently wraps your model to gain the “Zero-Copy” speed benefits while maintaining a simple, predictable execution model.
TL;DR: CAS Gateway brings Python/R execution to the CAS worker nodes using zero-copy Apache Arrow memory sharing. It removes per-row serialization overhead and gives large batch scoring significant speedups, use the default single-node mode for safety and switch to distributed mode only for extreme scale and stateless code.
Prerequisites: - SAS Viya LTS 2024.09 or later and SAS Model Manager 2025.01+. - Python 3.10+ with pandas, pyarrow, and swat available on worker images. - Permissions to run the gateway action set and to deploy model resources to CAS worker nodes.
Security / Trust note: Only run models and pickle files from trusted sources. Loading pickles or executing arbitrary code on CAS worker nodes can be unsafe; scan artifacts, review code, and use signed or vetted model bundles when possible.
Find more articles from SAS Global Enablement and Learning here.
Dive into keynotes, announcements and breakthroughs on demand.
Explore Now →The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.