Inspiration

The idea for TLF2SAS came from the daily work of clinical programmers who spend a lot of time turning TLF mock shells into SAS code, especially when facing time-sensitive ad-hoc requests from study teams or regulatory reviewers. These last-minute coding tasks are repetitive and stressful, often done under tight deadlines. I wanted to build a simple tool that could quickly read a mock shell and automatically create clean, ready-to-use SAS code. The goal was to help programmers respond faster to urgent requests, reduce errors, and make the reporting process more efficient.

What it does

TLF2SAS is a web application that automatically converts TLF mock shells into ready-to-run SAS programs. Users simply paste their mock shell text into the website, and the app uses Google’s Gemini model to generate clean, well-documented SAS starter code. The output includes editable parameters, dataset checks, and clear comments that make the code easy to understand and customize. It helps clinical programmers quickly produce high-quality tables, listings, and figures without starting from scratch, saving time and reducing errors in fast-paced reporting environments.

How we built it

We built TLF2SAS using FastAPI, Jinja2, and Google Gemini AI. It’s deployed on Google Cloud Run with Docker. The app turns TLF mock shells into SAS code through a simple web interface.

Challenges we ran into

The main challenges were limited time, handling ad-hoc testing, and keeping Gemini’s SAS output consistent. We also lacked diverse mock shell templates and high-quality SAS code samples to fully test and validate output accuracy.

Accomplishments that we're proud of

We are proud that TLF2SAS is a fully functional and reliable web app that converts TLF mock shells into clean, ready-to-run SAS programs. It runs smoothly on Cloud Run, handles ad-hoc requests efficiently, and has strong market potential among clinical SAS programmers who need faster, more consistent code generation tools.

What we learned

We learned how to connect Google Gemini AI with FastAPI to build a practical web app, how to deploy and scale it using Cloud Run, and how important real mock shells and good SAS examples are for improving AI output quality and reliability.

What's next for TLF2SAS

Next, we plan to support more input document types such as PDF, DOCX, and image files, add accuracy checks before code generation, improve the quality and simplicity of the SAS output, and reduce the overall runtime to make code generation faster and more efficient.

Built With

Share this project:

Updates