Developing a ChatGPT client and interface for a modern platform or device is all the rage, but what if you transported the powerful bit of AI technology back to the MS-DOS powered 1980s?
That's precisely what Yeo Kheng Meng has managed to do, even though DOS does not have native networking capabilities. The machine in question is the vintage IBM 5155 Portable PC, first released in 1984, powered by a (not-so-powerful anymore) 4.77 MHz Intel 8088 CPU and 640KB of RAM.
The first major hurdle was finding a compiler that could support the roughly 40 years of history between this old PC and ChatGPT - with the Open Watcom C/C++ compiler fitting the bill. During development, testing was carried out via a virtual machine running MS-DOS 6.22, which makes sense. However, it would have been cooler if builds were stored on giant floppy disks and transferred to the old IBM PC every few hours.
The biggest hurdle, of course, was networking and connecting to the ChatGPT service. ChatGPT needs billions of times more computing power than what a 1980s PC can deliver. The networking issue was resolved, with Yeo Kheng Meng noting, "DOS programs with TCP/IP network abilities have been written before, so this was definitely possible."
Thanks to open-source, he got it all working with clever tinkering, parsing, and API magic. A special shout-out goes to MTCP, written by Michael B. Brutman, as one of the essential libraries and networking tools facilitating the connection to ChatGPT's Chat Completion API. Be sure to check out Yeo Kheng Meng's full blog post for all the technical details.
"Considering this is my first time coding for the DOS platform and on this old IBM PC at that," Yeo Kheng Meng writes. "I was actually impressed by the performance of old machines like this. And before you ask, I did not use ChatGPT for help to code this app in any way."
But he did so after the fact. And you can see the response below, alongside a video of ChatGPT running on a PC from the 1980s.