``ChatGPT client for DOS'' that can talk with ChatGPT on IBM PC 40 years ago will be developed



OpenAI's interactive AI ChatGPT is an AI that responds with natural sentences similar to humans just by entering text. Engineer

Yeo Kheng Meng reported that he developed a client for DOS using this ChatGPT API and succeeded in running it on the IBM PC5155 , a PC about 40 years ago.

Building a DOS ChatGPT client in 2023 - YKM's Corner on the Web
https://yeokhengmeng.com/2023/03/building-a-dos-chatgpt-client-in-2023/

GitHub - yeokm1/doschgpt: A proof-of-concept ChatGPT client for DOS.
https://github.com/yeokm1/doschgpt

Yeo's oldest DOS machine was a 1984 IBM PC5155. 'If this IBM PC5155 can run ChatGPT, it should run on just about any other DOS machine,' Yeo said.



The specs of the IBM PC5155 are as follows

・Intel 8088 4.77Mhz CPU
640KB conventional memory (with upgrade kit)
・CGA ISA Graphics
・NE2000 compatible ISA Ethernet adapter
・XT-IDE ISA drive controller
・MS-DOS 6.22

Naturally, 16-bit DOS cannot run 64-bit Windows by default. So development was done by setting up a virtual machine running DOS 6.22.

And the biggest coding problem was the network API. This is because DOS does not come with a networking API natively. However, since he had experience creating programs for DOS that corresponded to TCP / IP networks before, Mr. Yeo decided that it was technically possible.

As a result of his research, Yeo turned his attention to a network standard called the Packet Driver API, which was developed in 1983. It seems that an open source network library ` ` mTCP '' that makes old PCs compatible with TCP / IP networks using this Packet Driver API was found.

The outline of the mTCP library is as follows. The mTCP library must be integrated into the application and communicates with the manufacturer-provided packet driver running as a Terminate-and-Stay-Resident (TSR) program. The TSR program sleeps in the background until called by an application and communicates directly with the network card.



Then there was the issue of communication protocols. Yeo has developed a Slack client that also runs on Windows 3.1 in the past, and like this Slack, the ChatGPT API was also encrypted via HTTPS.

A fierce man who developed a Slack client that runs on Windows 3.1 appeared - GIGAZINE



In order to solve this communication protocol problem, he used a proxy ` ` http-to-https-proxy '' that upgrades the HTTP connection of a system that cannot make HTTPS requests to an HTTPS connection, which was developed at the time of Windows 3.1 version of Slack. In other words, instead of communicating directly between OpenAI's server and PC 5155, it is a method of communicating via a modern PC running 'http-to-https-proxy'.



``Purists may not like this solution, but this is the best way I can solve it in a reasonable amount of time,'' Yeo commented.

Furthermore, the chain of network stacks is managed by a single-tasking DOS application, which will also hang while waiting for user input. Therefore, referring to the sample code of the mTCP library, the program was devised to save the keyboard input in a local buffer and output it to the console so that the program would not be paused.



You can see how you actually talk to ChatGPT on PC 5155 in the following movie.

DOS ChatGPT client on a 1984 IBM Portable PC 5155-YouTube


Mr. Yeo said, “I don’t think this development would have been possible without the mTCP library. It would have been very difficult,' he said.

When Mr. Yeo asked ChatGPT, 'Can you code a ChatGPT client for DOS machines?' Please note that it may be difficult to create a DOS ChatGPT client because it may not exist.' 'This challenge has already been accomplished and won,' commented Yeo.

in Software,   Web Application,   Hardware,   Video, Posted by log1i_yk