This summer, I had the opportunity to intern remotely at Ternary as a Software Engineer on the Product Delivery team. Drawing on my data science background, my primary summer project focused on improving Ternary’s cloud cost forecasting capabilities.

Enhancing forecasting with Prophet

Forecasting cloud spend accurately is vital for our customers. It helps them avoid budget surprises, align finance and engineering, and plan for innovation. 

Ternary already supported a fast, lightweight linear regression model, but it had limits. It could not fully account for seasonal patterns or longer-term trends. To address these gaps, I explored Meta’s open-source time series library, Prophet, as an alternative modeling tool. 

One of Prophet’s key advantages is its built-in cross-validation capability, which splits the time series at multiple cutoff points, trains the model on the historical data, and compares the resulting forecasts to actual future values. This makes it easy to compute error metrics and fine-tune hyperparameters to minimize the errors. Given that our forecasts had to remain adaptable across various business dimensions, such as service types, regions, and projects, this structured fine-tuning was essential.

After comparing Prophet to our existing linear regression model across different forecast windows, we found that:

  • Prophet performs better when there is enough historical data and pattern complexity
  • Linear regression remains strong for short-term, simpler forecasts

Instead of replacing one model with the other, we decided to support both: retaining linear regression for fast, lightweight predictions, and offering Prophet for richer, long-term forecasting.

Building the integration

I developed a backend solution to support both daily and weekly forecast resolutions, integrating a Python-based Prophet service into Ternary’s Go-based API. Key steps included:

  • Creating a bridge between the Go backend and the Python forecasting service
  • Writing thorough test cases for schema validation and confidence interval accuracy
  • Deploying the new functionality to staging using Terraform 

The chart below shows linear regression in our user interface, which produces a straight-line forecast. While this approach is fast and effective for straightforward, short-term predictions, it falls short when patterns grow more complex.

The chart below shows Ternary Forecasting with Prophet, which captures seasonality and trend changes, allowing for forecasts that more closely follow real-world cloud cost behaviors.

linear forecasting with prophet

This was my first time working with Go and Terraform. While there was a learning curve, the experience was incredibly rewarding and strengthened my technical skills. I was also able to demo the Prophet user interface to my teammates, which gave me a chance to showcase my progress firsthand and gather valuable feedback.

In addition to building Prophet support, I extended our linear regression forecast outputs to return confidence intervals, giving users a more informative range of predicted values. To support team collaboration and future development, I also updated internal documentation to clearly explain how to query the forecasting endpoint.

Toward the end of my internship, I began exploring ways to optimize Prophet’s performance by offering a limited set of frequently used configurations that customers can select for faster, more efficient forecasting. These models could be pre-trained and stored to reduce computation time, with retraining triggered when performance degrades.

Team dynamics

This was my first experience working within an Agile team using Jira and sprint cycles, and I quickly saw the value in the structure it provided. Daily standups were especially helpful. They gave me a consistent rhythm for tracking my progress and maintaining a clear sense of direction. They kept me focused on what I had accomplished, what I was working on, and what came next. Even though our team was fully remote, these routines kept us well-connected and aligned. The virtual format of this role supported strong collaboration while also giving me the flexibility to structure my workday in ways that improved both focus and productivity.

I’m especially grateful to Yalei Wang, our VP of Product Delivery, for providing guidance on structuring a fine-tuning pipeline, which was instrumental in shaping the early stages of my Prophet implementation. I primarily collaborated with our Product Lead, AJ Peter, and two other engineers on the team, Kyle Rattet and Alan Cham. They were incredibly supportive this summer. We met throughout the internship to review my findings, troubleshoot roadblocks, and align on next steps. One of our team discussions even led to the decision to include confidence intervals in forecast results, which significantly improved the user experience. A special shoutout to Alan, who helped me navigate the onboarding and deployment processes.

Final thoughts

This internship gave me the chance to apply data science in a real-world engineering context. I learned to balance accuracy, performance, and scalability while working with a production system. I gained experience with Go, API design, Terraform, time series modeling, and practical FinOps applications.

I’m thankful to the Ternary team for the mentorship and support they provided. As I begin my Data Science master’s program at the University of Washington, I’ll take these skills and lessons with me.