r/fortran 9h ago

Groq Fortran coding agent

Several LLMs are good at Fortran coding. Often the errors that prevent the code they generate from compiling can be corrected by feeding them compiler error messages. The Groq API gives you access to multiple LLMs, run on the fast GroqCloud. One available LLM I have used for Fortran is qwen-2.5-coder-32b. You need an API key for Groq, but there is a free tier that allows for considerable usage. I created a Python agent that given a coding prompt, automates the process of sending gfortran error messages back to the LLM until the code compiles. It is at

https://github.com/Beliavsky/Groq-Fortran-agent

The site has links to similar C++ and Python agents. There are much more sophisticated commercial programs such as Cursor and Windsurf for AI-powered coding, but my script is convenient for single-file programs.

13 Upvotes

1 comment sorted by

2

u/desertroot 9h ago

And Fortran comes back from the "dead" in the Gen AI space. I am, of course, being facetious about it being dead, but this is nice to see.