Hobbyist programmes ChatGPT client for MS-DOS
News + Trends

Hobbyist programmes ChatGPT client for MS-DOS

Martin Jud
28.3.2023
Translation: machine translated

A retro enthusiast from Singapore has got ChatGPT running on a 40-year-old computer. He has programmed a client for MS-DOS that uses a few tricks to enable futuristic AI conversations.

Yeo Kheng Meng is no unknown quantity. He took on the instant messaging service Slack back in 2019. He programmed a Slack client for Windows 3.1, which was launched in 1992. His latest project is once again dedicated to a chat programme - but this time it is a programme with artificial intelligence. And he is travelling even further back in time, as his ChatGPT client for MS-DOS even runs on an IBM PC from the early 1980s.

The computer in the video is an IBM 5155 Portable PC from 1984 with MS-DOS 6.22. It has an Intel 8088 processor with 4.77 megahertz, which first saw the light of day in 1981 together with MS-DOS 1.0. For the hobbyist, this is the perfect device, because: "If my application runs on this IBM computer, it should also run on pretty much any other DOS computer."

As you can see in the video, ChatGPT runs under MS-DOS as a full-screen, text-only application. There are several hurdles to its implementation. The ChatGPT APIs published by OpenAI at the beginning of March make it possible for Yeo to programme a client at all. He uses the Chat Completion API for programming on the one hand and draws on open source resources on the other. To compile the code written in 64-bit Windows for 16-bit DOS, he uses Open Watcom C/C++. To test the software, he uses the virtualisation software Virtualbox - a virtual machine with MS-DOS 6.22.

It takes a while for the response to appear, but ChatGPT works with MS-DOS.
It takes a while for the response to appear, but ChatGPT works with MS-DOS.
Source: Yeo Kheng Meng

The biggest challenge for Yeo during implementation is the fact that there are no network APIs for MS-DOS. At least not out of the box. He solves the problem by using a network standard from 1983 called PC/TCP Packet Driver and an open source network library mTCP.

Other stumbling blocks in the implementation are the lack of multithreading of the old processor and the fact that ChatGPT requires an encrypted HTTPS connection. Yeo solves this problem by using an HTTP-to-HTTPS proxy. If you would like to know more about this project, the hobbyist has documented his work here. He has published the code for the ChatGPT client for MS-DOS on GitHub.

Caption photo: Yeo Kheng Meng

43 people like this article


User Avatar
User Avatar

I find my muse in everything. When I don’t, I draw inspiration from daydreaming. After all, if you dream, you don’t sleep through life.


These articles might also interest you

Comments

Avatar