VOGONS


WinGPT, AI chat bot for Windows 3.1

Topic actions

First post, by dialup

User metadata
Rank Newbie
Rank
Newbie

Hey everyone, I wanted to share my latest project that I've been working on for Windows 3.1. It's called WinGPT, and it's an AI chat bot, based on ChatGPT/the OpenAI API.
It has the ability to connect directly via TLS 1.2/1.3 to OpenAI's servers, so you don't need a modern machine to proxy your requests.

wingpt_computer.png
Filename
wingpt_computer.png
File size
16.5 KiB
Views
2285 views
File license
CC-BY-4.0

You can download it here - I also wrote a bit about the challenges I faced making the TLS part work. https://www.dialup.net/wingpt/
I hope others can enjoy it too!

Reply 1 of 35, by jakethompson1

User metadata
Rank Oldbie
Rank
Oldbie

Nice. I also have an interest in this area but have never gone to the step of actually trying to port a TLS library to Win16. I would have bet on mbedTLS but I see you did WolfSSL.

Programming Windows admonishes you not to build anything as "Large" (multiple code, multiple data) but to stick with "Small" (multiple code, single data) but I think it doesn't apply in protected mode which obviously you're going to stick to.

Anything "const" (like tables for AES, etc.) could arguably go into a code section instead of data possibly helping you to get data under 64K, but I don't know how you could convince a C compiler to do that.

Reply 2 of 35, by dialup

User metadata
Rank Newbie
Rank
Newbie

Thanks! I did look into mbedTLS, but the team seemed to think it wouldn't work well on a 16-bit platform because of assumptions it makes about size_t (https://forums.mbed.com/t/mbed-tls-size-t/3103).

I'm actually not sure I really understood from reading Programming Windows why the Large model is a bad idea in practice. The book says the data segments have to be fixed in memory, and only one instance can run at a time, which I guess could be a problem for some programs, but it feels like it would be less of an issue with a DLL—you probably understand it better than I do. I do like the bit in the book about "If Word for Windows can figure out how to use the Small model, surely your program can" 😀

Reply 3 of 35, by Jo22

User metadata
Rank l33t++
Rank
l33t++

Well done! 👋😃

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 4 of 35, by keenmaster486

User metadata
Rank l33t
Rank
l33t

Very interesting work. Someday, I'd like to work on a project to create a modern browser for old operating systems that has support for modern TLS and CSS.

World's foremost 486 enjoyer.

Reply 7 of 35, by appiah4

User metadata
Rank l33t++
Rank
l33t++
dialup wrote on 2023-06-25, 22:44:
Hey everyone, I wanted to share my latest project that I've been working on for Windows 3.1. It's called WinGPT, and it's an AI […]
Show full quote

Hey everyone, I wanted to share my latest project that I've been working on for Windows 3.1. It's called WinGPT, and it's an AI chat bot, based on ChatGPT/the OpenAI API.
It has the ability to connect directly via TLS 1.2/1.3 to OpenAI's servers, so you don't need a modern machine to proxy your requests.

wingpt_computer.png

You can download it here - I also wrote a bit about the challenges I faced making the TLS part work. https://www.dialup.net/wingpt/
I hope others can enjoy it too!

Ok, let me get this right - did you make it so that ChatGPT answers as if the year is 1990-something?

Retronautics: A digital gallery of my retro computers, hardware and projects.

Reply 8 of 35, by doshea

User metadata
Rank Member
Rank
Member

Looks like an interesting programming project, I look forwarding to reading about your experiences later!

appiah4 wrote on 2023-06-27, 07:02:

Ok, let me get this right - did you make it so that ChatGPT answers as if the year is 1990-something?

I didn't notice that, the screenshot on the website is different but also based in a similar era 🤣

Reply 10 of 35, by matti157

User metadata
Rank Member
Rank
Member

The most interesting part and the one less "in the spotlight" than your project is the porting of WolfSSL to 16bit for Windows 3.1

Here in Italy many computer magazines are reporting the news but without this detail, you should make a dedicated thread 😉

Reply 12 of 35, by doshea

User metadata
Rank Member
Rank
Member
appiah4 wrote on 2023-06-27, 07:02:

Ok, let me get this right - did you make it so that ChatGPT answers as if the year is 1990-something?

The OP announced this on Hacker News too, and some people including OP explained how it that part works here - basically yes, 1992, and also told it to not mention the current year 😁

I ran across the HN post while looking up the thing OP mentioned about commctrl.h not being available on Windows 3.1 because it's the top Google search result for '"windows 3.1" "commctrl.h"'! The answer is that it was added in Windows for Workgroups 3.1 apparently.

Regarding this from the OP's blog post about the TLS library:

In particular, WolfSSL's internal.c file is a whopping 1.25MB (too large for even GitHub to render), and would fail the build every time I enabled a feature I needed.

I was able to get that file down to a size that would fit into two segments by moving code around into two files, internal.c and internal2.c—elegant, I know!

From the OpenWatcom 1.9 documentation (what I have on hand), it looks like these compiler options might have helped:

zm place each function in separate segment (near functions not allowed) [...]
zmf (C++ only) place each function in separate segment (near functions allowed) [...]

The manual describes some drawbacks; I gather those options could make performance worse than just splitting across two files.

I imagine there is probably some way to explicitly assign some functions to a different segment using #pragma, a linker configuration file, or something, but I don't know for sure, and it'd be less portable than splitting into separate files.

Reply 13 of 35, by Aqua

User metadata
Rank Newbie
Rank
Newbie
dialup wrote on 2023-06-25, 22:44:
Hey everyone, I wanted to share my latest project that I've been working on for Windows 3.1. It's called WinGPT, and it's an AI […]
Show full quote

Hey everyone, I wanted to share my latest project that I've been working on for Windows 3.1. It's called WinGPT, and it's an AI chat bot, based on ChatGPT/the OpenAI API.
It has the ability to connect directly via TLS 1.2/1.3 to OpenAI's servers, so you don't need a modern machine to proxy your requests.

wingpt_computer.png

You can download it here - I also wrote a bit about the challenges I faced making the TLS part work. https://www.dialup.net/wingpt/
I hope others can enjoy it too!

hi dialup,
is there an Offline Open AI Pack available for WinGPT similar to GPT4All ??
Maybe a lot smaller, because GPT4ALL still contains a good 3.5GB of data, which you can't accommodate on 2GB FAT16 partitions with the best will in the world... 😁
Or is something like this still planned?
In any case, it's great that someone like you even came up with the idea of doing something like this. 🙂

Thanks for Reply
Greets

Am5x86 PCI 3dfx Voodoo1.
AMD K6-2 500 3dfx Voodoo2 SLI.
Toshiba P200MMX PC Card Wonder.
Dell Optiplex Small PC Intel Core Duo.
Dell Vostro 1000 AMD64 X2 LD-52.

Reply 14 of 35, by Aqua

User metadata
Rank Newbie
Rank
Newbie
keenmaster486 wrote on 2023-06-26, 15:20:

Very interesting work. Someday, I'd like to work on a project to create a modern browser for old operating systems that has support for modern TLS and CSS.

That's a very good Idea, because when i was with Opera 3.60 16Bit with 128Bit TLS Encryption, CSS Support.. in the mobile Facebook with WFW 3.11 are Long Times ago..
😉
Good Luck and i hope so as well for your Results. 🙂

Am5x86 PCI 3dfx Voodoo1.
AMD K6-2 500 3dfx Voodoo2 SLI.
Toshiba P200MMX PC Card Wonder.
Dell Optiplex Small PC Intel Core Duo.
Dell Vostro 1000 AMD64 X2 LD-52.

Reply 15 of 35, by Cyberdyne

User metadata
Rank Oldbie
Rank
Oldbie

Wow TLS 1.2 and 1.3 on Windows 3.1x.... 😮

There is a possibility of a functional browser without a proxy. And it will be the most secure. Today no hackers, malware and viruses know about 16bit Windows enviroment. 🤣

I am aroused about any X86 motherboard that has full functional ISA slot. I think i have problem. Not really into that original (Turbo) XT,286,386 and CGA/EGA stuff. So just a DOS nut.
PS. If I upload RAR, it is a 16-bit DOS RAR Version 2.50.

Reply 16 of 35, by Big Pink

User metadata
Rank Member
Rank
Member
Cyberdyne wrote on 2023-07-28, 08:23:

Wow TLS 1.2 and 1.3 on Windows 3.1x.... 😮

There is a possibility of a functional browser without a proxy. And it will be the most secure. Today no hackers, malware and viruses know about 16bit Windows enviroment. 🤣

Forget 2FA. Bank online with Windows 3.1 and only take money out of cash machines running OS/2 😁

I thought IBM was born with the world

Reply 17 of 35, by Aqua

User metadata
Rank Newbie
Rank
Newbie
Big Pink wrote on 2023-07-28, 14:53:
Cyberdyne wrote on 2023-07-28, 08:23:

Wow TLS 1.2 and 1.3 on Windows 3.1x.... 😮

There is a possibility of a functional browser without a proxy. And it will be the most secure. Today no hackers, malware and viruses know about 16bit Windows enviroment. 🤣

Why Not ?? Opera 3.60 16-Bit supports SSL 1.2
Reactivate Arachne for DOS as Win32 Virus "Security" ??🤔😎😁

Am5x86 PCI 3dfx Voodoo1.
AMD K6-2 500 3dfx Voodoo2 SLI.
Toshiba P200MMX PC Card Wonder.
Dell Optiplex Small PC Intel Core Duo.
Dell Vostro 1000 AMD64 X2 LD-52.

Reply 18 of 35, by Cyberdyne

User metadata
Rank Oldbie
Rank
Oldbie
Aqua wrote on 2023-07-28, 15:07:
SSL 1.2 has no functinality in todays internet. For DOS we do have a TLS based browser. But it is not Arachne. […]
Show full quote
Big Pink wrote on 2023-07-28, 14:53:
Cyberdyne wrote on 2023-07-28, 08:23:

Wow TLS 1.2 and 1.3 on Windows 3.1x.... 😮

There is a possibility of a functional browser without a proxy. And it will be the most secure. Today no hackers, malware and viruses know about 16bit Windows enviroment. 🤣

Why Not ?? Opera 3.60 16-Bit supports SSL 1.2
Reactivate Arachne for DOS as Win32 Virus "Security" ??🤔😎😁

SSL 1.2 has no functinality in todays internet. For DOS we do have a TLS based browser. But it is not Arachne.

Windows 3.11 FWG can be 16bit or Win32s.

DOS can be 32bit or even 64bit.

I am aroused about any X86 motherboard that has full functional ISA slot. I think i have problem. Not really into that original (Turbo) XT,286,386 and CGA/EGA stuff. So just a DOS nut.
PS. If I upload RAR, it is a 16-bit DOS RAR Version 2.50.

Reply 19 of 35, by Aqua

User metadata
Rank Newbie
Rank
Newbie
Big Pink wrote on 2023-07-28, 14:53:

Forget 2FA. Bank online with Windows 3.1 and only take money out of cash machines running OS/2 😁

who would also come up with the idea of doing online banking with Win 3.1? 🤔

For me, DOS with Windows 3.1x has a lot of fun factor.
Anyway, I was able to do what I wanted.
Download photos on FB, take a quick look on E-Bay without logging in..

I also liked the way I went online.
When the wifi pcmcia card found the add hoc spot from one of my nokia n95 it beeped at joikuspot.
I thought it was funny, because not everyone had that either.

The setup of Novell Network including Pcmcia drivers had to be done exactly according to a scheme, because otherwise it wouldn't work.
In addition, the bindings in the Net.cfg had to be corrected because they were entered incorrectly.

Then you had to find an autologin tool because I didn't feel like logging into the Windows network every time.
It's just not like Win9x and higher.
You often had to search a long time.
Don't ask me how long I've been looking for a 16 bit stopwatch because I wanted an indication of how long I've been online. 😁
Finally found one.

https://m.youtube.com/watch?v=rtKuk2jVpRc

https://m.youtube.com/watch?v=DOZiGhUTfsM

Windows 3.1 and 3dfx is just like a never ending story.
I don't know if young people even understand that.
Doesn't matter.

Well, why I actually ended up in this thread applies to WinGPT with offline solutions, because as is correct in a GPT4ALL thread, not everyone wants to entrust input to a cloud.
Also, you don't need internet.

Greets Aqua

Am5x86 PCI 3dfx Voodoo1.
AMD K6-2 500 3dfx Voodoo2 SLI.
Toshiba P200MMX PC Card Wonder.
Dell Optiplex Small PC Intel Core Duo.
Dell Vostro 1000 AMD64 X2 LD-52.