On Sunday, Yeo Kheng Meng, a Singapore-based retrocomputing enthusiast, released a ChatGPT client which can run on an IBM PC from 1981 with a 4.77 MHz processing speed. The client was built to allow users to converse using the popular OpenAI language model.
In 2019, Yeo created a Slack client for Windows 3.1, furthering his expertise in vintage computer development. Crafting such projects is a natural talent of his.
Using different strategies for development, he challenged himself to create something for the old MS-DOS platform. On his blog, he wrote that this is part of OpenAI’s release in November of ChatGPT, a powerful AI-based LLM.
ChatGPT is an AI model specifically designed for conversation, drawing from Internet-sourced information to respond to questions and create text. With the recently released API, people with appropriate programming abilities can apply ChatGPT directly to their applications.
Yeo’s new app, designed to run on MS-DOS, enables him to use a classic IBM PC-compatible computer for Internet conversation with ChatGPT.
Like the traditional ChatGPT web interface, a text-only fullscreen application running on an antique machine gives users the same back-and-forth conversation.
Overcoming Development Challenges: Strategies & Best Practices
The platform of MS-DOS posed a particular challenge for a ChatGPT client, given its lack of native networking abilities.
Yeo focused on creating applications that would be feasible to run on a 1984 IBM 5155 Portable PC, which has an Intel 8088 4.77 MHz CPU, 640KB of RAM, CGA ISA graphics, and MS-DOS 6.22 – a computer with extraordinarily limited processing power by today’s standards.
Yeo used a VirtualBox virtual machine running DOS 6.22 and Open Watcom C/C++, a modern compiler running on Windows 11, to create the client. Yeo tested the compiled binary on his virtual machine to ensure efficient development and then transferred it to the target IBM DOS PC for further testing.
Weaving his way through several layers, Yeo utilized the Packet Driver API standard invented in 1983 to manage networking on the IBM PC.
He added networking capabilities to the client application by integrating the open-source MTCP library, developed by Michael B. Brutman, which communicates with the Packet Driver.
Using C, Yeo manually constructed the POST request for OpenAI’s Chat Completion API and parsed its JSON-formatted response to construct the ChatGPT API.
However, Yeo encountered a roadblock: the ChatGPT APIs necessitated encrypted HTTPS connections, but due to the lack of native HTTPS libraries for MS-DOS, this posed an issue.
Yeo created an HTTP-to-HTTPS proxy that serves as a transparent middleman, allowing it to bridge the MS-DOS client and ChatGPT’s secure API. This proxy can run on modern computers and translate requests and responses between the two.
MTCP page and online samples served as the reference for Yeo when attempting to tackle another challenge–that of reading and writing console input despite the single-threaded nature of DOS applications. He accomplished this task by devising a way to check and receive keypresses without pausing the program.
Yeo was pleasantly surprised by the result of his client project. Looking forward to future challenges, he wrote a blog post to detail the process he went through while developing the software. He concluded his post by expressing his desire to write more retro software.
“doschgpt”–a code released by Yeo on GitHub–enables creativity in utilizing the latest AI language models, even for those with limited technology. Enabling users to run, improve, and extend the code gives people more opportunities for breakthroughs.
The ChatGPT Client for MS-DOS Hobbyists is a valuable tool for anyone interested in experimenting with chatbot creation and natural language processing. Its accessibility and compatibility with older computer systems make it a unique and fun option for hobbyists, while its advanced capabilities offer limitless potential for chatbot creation.
Source: Ars Technica