WinGPT AI Assistant for Windows 3.1 Released, Only 218KB

Windows 3.1
(Image credit: Wikimedia Commons)

A developer has prepared a Windows 3.1 compatible application dubbed WinGPT. Described as an “AI Assistant for Windows 3.1,” the WinGPT app connects to the ChatGPT API natively. According to a blog post on the developer site dialup.net, the WinGPT app was developed so that Windows 3.1 users won’t feel closed off from the AI chatbot buzz that is prevalent in 2023.

WinGPT was written in C, compiled in Open Watcom v2, and uses a standard Windows API. This helps the resulting app look simple and very much like the Windows 3.1 era, as you can see. The same developer has prepared a TLS (Transport Layer Security) 1.3 protocol library so that Windows 3.1 can connect to the ChatGPT API natively. Compared with modern apps, this is a very light download, a zip file of only 218 KB includes a readme, the application, and the aforementioned TLS 1.3 DLL support file.

(Image credit: dialup.net)

As the WinGPT app stands today, it is touted as being capable of helping Windows 3.1 users: do research, answer queries and questions, provide advice and tell jokes, and participate in other entertaining chats, working as a productivity helper by drafting documents and so on. However, the developer admits it isn’t the best way to access ChatGPT and can be limited and unreliable.

(Image credit: dialup.net)

Some of WinGPT’s problems for users stem from the limited memory available on Win 3.1 machines. “JSON responses of modern APIs aren't especially optimized for size, and OpenAI's API is no exception,” notes the developer. Moreover, to conserve memory, the app doesn’t send chat history to the API calls, which means ChatGPT doesn’t use prior conversational context in this app.

Despite these drawbacks, getting up and running with WinGPT seems far simpler, easier, and fully featured than the DOS ChatGPT client we reported on in March.

If you want to try WinGPT, go and grab the lightweight download (scroll to the bottom of the article linked), which is licensed under GPL v2. The source code is also available. The program runs not just on Windows 3.1, but on “any 16-bit or 32-bit version of Windows post-Windows 3.1,” according to the developer. However, an implementation of Winsock is required, and it won’t run directly on Windows 64-bit editions (an emulator like Wine will be required). Lastly, an OpenAI API key is required, and you must enter it into the program’s options menu before you get started.

Mark Tyson
Freelance News Writer

Mark Tyson is a Freelance News Writer at Tom's Hardware US. He enjoys covering the full breadth of PC tech; from business and semiconductor design to products approaching the edge of reason.

  • Neilbob
    I'm sure it's just me being well past it, but I honestly don't see the point of 'AI' in a consumer setting.

    This applies more to ChatGPT and others like it than this Windows 3.1 thingy, but when I saw this article and description of what it can provide the user, the first thing that popped (oddly) in my mind were those old Catz and Dogz applications that were interesting for about 10 minutes before the novelty wore thin.

    But as mentioned, I am past it, and also incredibly cynical. And more than a little grumpy.
    Reply
  • Metal Messiah.
    WinGPT seems to prepend every user prompt with:

    You are a friendly but concise chat bot. Answer all questions in the present tense as if it is 1992, and make no reference to the current year.
    Reply
  • Metal Messiah.
    Memory is quite limited on Windows 3.1 machines, so I tried to reduce the amount of memory needed for WinGPT, especially in sending and receiving the query and response from the OpenAI API.

    The JSON responses of modern APIs aren't especially optimized for size, and OpenAI's API is no exception. I've asked the model to be brief in an effort to keep responses as small as possible. I 've also chosen not to send the text of previous turns in the API calls, even though this means that the bot won't be able to use prior conversation context. https://www.dialup.net/wingpt/
    You can also trade space for CPU time using SAX-style parsing. SAX-style parsing visits each node of a tree from top to bottom, firing events for each node visited. The amount of memory required compared to fully parsing JSON is negligible, and writing a custom SAX-style parser for JSON shouldn't be too difficult.

    There are existing SAX-style JSON parsers you can examine as well.

    https://en.wikipedia.org/wiki/Simple_API_for_XML

    https://rapidjson.org/md_doc_sax.html
    But I presume you used JSMN (https://github.com/zserge/jsmn) instead, a streaming parser that visits each token sequentially, so there's only one copy of each JSON response in memory ? JSMN is also neat.

    void DestructivelyUnescapeStr(LPSTR lpInput) { int offset = 0;
    int i = 0;
    while (lpInput != '\0') {
    if (lpInput == '\\') {
    offset++;
    } else {
    lpInput = lpInput;
    }
    i++;
    }
    lpInput = '\0';
    Reply
  • bit_user
    First, I'll admit I totally got click-baited by the headline mentioning 218 kB.

    Metal Messiah. said:
    You can also trade space for CPU time using SAX-style parsing. SAX-style parsing visits each node of a tree from top to bottom, firing events for each node visited. The amount of memory required compared to fully parsing JSON is negligible, and writing a custom SAX-style parser for JSON shouldn't be too difficult.
    Why is memory even an issue? Win 3.1 implements the Win32 API, does it not? I always thought Windows 3.x apps could use 32-bit segments, on 386 and later. If so, then you probably have up to like 1 GB to play with.

    Anyway, I've used both SAX and DOM parsers. Using one when you really want the other is always painful. For parsing documents, you'd ideally have a DOM parser that supports XPath, so you don't have to manually walk the tree.
    Reply
  • Metal Messiah.
    bit_user said:
    First, I'll admit I totally got click-baited by the headline mentioning 218 kB.

    Why so, I mean in what aspect ?
    Reply
  • bit_user
    Metal Messiah. said:
    Why so, I mean in what aspect ?
    I was wondering what the heck kind of model they could squeeze into that amount of data and what kind of toy functionality it provides. I didn't think it'd be yet another client program, because how is that even news? Win 3.1 was primitive, but it wasn't like MS DOS primitive.
    Reply
  • Metal Messiah.
    I'm feeling 'Nostalgic' now. Want to install my Win XP disk and start playing some old games. But don't have any ancient hardware to fully support this OS, mobo, and CPU especially. After all, Windows XP was perfect for playing old DX8/9 games.

    Some of these old PC titles which I still have on DISK/CD, can't even run properly in Windows 7 OS, let alone Win 10.

    bit_user said:
    I was wondering what the heck kind of model they could squeeze into that amount of data and what kind of toy functionality it provides. I didn't think it'd be yet another client program, because how is that even news? Win 3.1 was primitive, but it wasn't like MS DOS primitive.
    Check this out. Kind of Off Topic. Intel's Gaudi2 on the rise ?

    Intel is claiming better price/performance than the A100 right now in FP16 workloads and is targeting beating NVIDIA's H100 by September (in FP8 workloads). This is quite an ambitious goal but the company has benchmarks to back this up.

    https://wccftech.com/intels-gaudi2-chip-is-the-only-alternative-to-nvidia-gpus-for-llm-training-as-per-mlperf-benchmarks/
    Reply
  • bit_user
    Metal Messiah. said:
    I'm feeling 'Nostalgic' now. Want to install my Win XP disk and start playing some old games. But don't have any ancient hardware to fully support this OS, mobo, and CPU especially. After all, Windows XP was perfect for playing old DX8/9 games.
    Just get an old Core 2 machine and slap a SSD in it. Should be a screamer, for retro gaming, and I think XP will support it just fine. The tricky part is probably going to be finding a good GPU that you can get the most up-to-date drivers for.

    Metal Messiah. said:
    Check this out. Kind of Off Topic. Intel's Gaudi2 on the rise ?

    Intel is claiming better price/performance than the A100 right now in FP16 workloads and is targeting beating NVIDIA's H100 by September (in FP8 workloads). This is quite an ambitious goal but the company has benchmarks to back this up.
    Yeah, well Habana seems to be a long time in coming. I've heard a continual drumbeat of driver activity, but not much else about them. After Intel already scrapped Nervana, I'm sure they didn't want to see Habana fizzle out.

    As for the performance claims, unlike the A100 and H100, which are mixed-use compute accelerators, Habana's are supposed to be pure-bred AI processors. So, if they know what they're doing, you'd think it should be within reach for them to compete with Nvidia.
    Reply
  • Metal Messiah.
    bit_user said:
    Just get an old Core 2 machine and slap a SSD in it. Should be a screamer, for retro gaming, and I think XP will support it just fine. The tricky part is probably going to be finding a good GPU that you can get the most up-to-date drivers for.

    I was having an old AMD FX 6300 CPU system, installed along with an 8800 Ultra GPU, running XP as the OS. But I gave the Mobo/CPU combo to someone else, who wanted some simple system for his office work. My GPU is still in working condition though. I also bought GT 1030.

    But I think building a new Core 2 Machine/PC won't be that expensive these days. But what about getting an old supported Mobo, along with supported drivers ? I think some motherboard models might be hard to find in the market these days.

    I can only install 4GB of DDR2/3 RAM which is more than enough for old PC games. Even 2GB might do. I would prefer buying a completely brand NEW assembled PC, rather than some old refurbished system.
    Reply
  • bit_user
    Metal Messiah. said:
    I can only install 4GB of DDR2/3 RAM which is more than enough for old PC games. Even 2GB might do. I would prefer buying a completely brand NEW assembled PC, rather than some old refurbished system.
    I seem to recall 32-bit XP had some limit of 2 GB or 3 GB? ...something about it using bit 31 of the physical address exclusively for kernel address space, which would at least mean you'd max out at 2 GB of userspace.

    As for new... I'm sure there've got to be a handful of unused motherboards hiding in basements, attics, closets, and storage lockers, but it seems like they're going to few & far between. I'd probably settle for "lightly used" and hope for the best. Get a popular model and it shouldn't be too hard to replace if it dies.

    I feel like there have got to be dedicated groups and websites for retro PC gaming. I'm sure there's a lot of advice and examples out there... good luck!
    Reply