This isn't really a great question for this site. The problem is that your vision is quite vague, and answering it would require a back-and-forth which this site is not set up for. I recommend you continue the conversation on the Lean Zulip, or one of the Coq forums (and also be more specific). But nonetheless, to get you started, I'll list some resources.
I want GPT to try running its proof scripts (and revising them if they fail) before suggesting them to me
I think the challenge is what "running its proof scripts" means. Are you talking about GPT generating a complete file's worth of code including relevant imports, theorem statements, and proofs? Do you want a pre-built web API where you can pass it a file's worth of text, and get back a response?
While I don't know of any existing web APIs, you could easily make your own. If you just want to run a file, you could make an API which takes in the text, puts it into a file and runs Lean, Coq, or Isabelle on that file like so:
# lean4
lean myfile.lean
# coq
coqc myfile.v
And I'm sure Isabelle has something similar. Then you would take the output and manipulate it into whatever form is best for you and send it back. (But be really careful to sandbox this. Lean code is a full programming language and code can delete files or run command line tools. Don't blindly run code.)
If instead you want something more REPL like, you could use Lean REPL as in Scott's answer, or SerAPI for Coq. (Or the Coq REPL.) The challenge however with a REPL is that you have to know how to divide up the code into individual commands. Of course GPT might be smart enough for this. If you want to run tactics one at a time, REPLs could be good for this.
Both Coq and Lean have a language server, and in my humble opinion, this is the future of LM-code interaction. Language servers not only report errors, but also let you investigate proof states, definitions, and other properties of the code. They facilitate a rich back-and-forth experience. How to most productively hook up a language server and a language model is still an open engineering problem.
It also isn't clear what you even want out of such as system. Is this for research? If so, you likely want to benchmark the system by measuring how well it does on a set of theorems. Or is this for end users? In which case, maybe you want more of a copilot like experience where GPT tries out the code locally in the current file (using the author's existing definitions and imports). This would likely require good editor integration and possibly use the language server or the tactic framework.
Also, many works not only use language models to generate a complete proof, but one tactic at a time, and then use a symbolic tree search to find a proof. This would be a more complicated interface.
Here is a quick list of some existing works you could draw inspiration from (in no particular order):
- Draft-Sketch-Prove uses Minerva+Codex to generate a natural language proof and convert it into a formal proof sketch in Isabelle which is completed with SledgeHammer.
- Baldur uses Minerva in Isabelle and makes corrections based on error messages.
- Segredo uses GPT-4 in Lean to try one tactic at a time and do a proof search. (It is usable by end users.)
- Lean Copilot uses finetuned transformer models to make tactic suggests and find proofs. The proofs are found with a tree search which checks if a tactic is valid after running it. It is based on ReProver from LeanDojo. (It is usable by end users.)
- CoqPilot is a vscode plugin for Coq which uses GPT-4 to suggest code inside your file. (It is usable by end users.)
- The Llemma model paper has experiments where they use the language model to generate proofs with Draft-Sketch-Prove style and Lean
- LeanDojo comes with ChatGPT plugin to interface with ChatGPT as you mentioned. (I think this is usable by end users.)
- Copra uses GPT-4 to suggest next steps which are used in a tree search.
All of these works probably set up the interface with Lean/Coq/Isabelle differently. I don't think there is yet a one-size-fits-all approach, and it heavily depends on what you want to do.