Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: TRS-GPT – ChatGPT client/server for the TRS-80 (druid77.github.io)
102 points by druid77 on Aug 26, 2023 | hide | past | favorite | 20 comments
Hi there HN community. I'm excited to show my personal project -- an open-source code and hardware approach that connects my 1980's TRS-80 Model III computer to an OpenAI server. The TRS-80 can hold a chat session with OpenAI, and it's all very retro feeling. There were challenges along the way, as the approach to interfacing between ancient hardware and modern software interface wasn't immediately available. Please see https://github.com/druid77/trs-gpt for all the details, and let me know if you have any ideas for improvements. For example, adding support for voice.


A more honest headline would be "TRS-80 connected through serial port to esp32"


Thanks for your comment. I think it's an accurate headline, as the client and server code I wrote (which goes through the hardware TRS-IO (which, yes, has the ESP32 chip on it)) allows for ChatGPT interaction on the TRS-80. The I/O module (TRS-IO) is just providing a way for a BASIC program (the "client") to send and receive network requests over the serial port. The client is essentially a dumb terminal, and doesn't have much logic at all. I’m running a python "server" on a Linux box (AWS EC2) that handles the request then constructs an OpenAI call from there, then passes the response back to the TRS-80. So that's what I'm trying to represent as the client/server in the headline :). Most of the work I did was in creating the client and server, not just plugging in hardware. Although I did spend a painful amount of time cleaning the keys, and just generally figuring out an approach. I think a good title would be "TRS-80 as a dumb terminal to ChatGPT".


Since the TRS-80 Model I was my first computer and the Model III was my second computer I do keep having a nostalgic desire to get a Model III or 4 to use. Reading these articles and seeing various YouTube videos about them may one day push me over the edge and try to buy one :)


But can it play a nice game of Chess?


Only if your name is Dr Falken!


Very cool! Would it even be possible to get llama.cpp running on this thing??


The CPU can only address 64k of RAM, so... no.


This computer only physically has 48k. That’s after upgrading. The base model has 16k as far as I understand how it came from RadioShack.


Could you have it write code and run it on the machine too?


I was experimenting with this just last week. The TRS-80 CoCo was my first computer and I still have one. A year or two ago I was able to read and write data to a modern digital audio recorder.

I think a program could be built to write the audio file that the TRS-80 would understand. Then you could translate a code file to audio and LOAD it. I wrote such a program with the help of ChatGPT last week but the wav file didn’t quite sound right. After more research, I think it might be right and I just don’t remember the sound quite right.

This post made me think you might be able to go the other way too. I vaguely remember a command to forward the audio cassette (maybe in seconds). The host computer could listen for that forwarding command and respond with its translated wav. Forward 5 seconds could be for API call #5.

This would require no extra hardware on the TRS-80 side. You would just connect the audio jacks into a sound card headphone/mic port.

Edit: As another commenter posted, serial would probably be much easier. I didn’t even realize it had serial IO.


That would be a really cool addition. GPT seems less good at writing BASIC code, than other modern languages though. I think since GPT mostly crawls online sources there was less training material put online overall. :)


With 3.5-turbo-16k you could include quite a lot of example code or extra BASIC documentation if you are concise.

Targeting some retro platform for ChatGPT code generation is something I have been thinking about. Especially now that we have fine tuning. Because the domain of a retro system is relatively limited compared to the scope of modern platforms.

Maybe someone could train it with like 300 type-in BASIC programs along with a good paragraph-long description for each.

Then we could just give it a paragraph describing what we want and if we are lucky get a tailor-made program.


Awesome project! Good job


That's cool!


It's almost SepTandy... good way to kick the month off.


On the wargames front, a modern TRS-80 speech synthesis module replacement: https://hackaday.com/2022/07/29/hackaday-prize-2022-modern-p...


The I/O module seems like overkill to me. It probably would be heck of a lot easier to turn a TRS 80 into a dumb terminal and just use serial connectivity to a Linux box.


Th I/O module (TRS-IO) is just providing a way for a BASIC programs to send and receive network requests over the serial port. So yes, I’m actually taking the dumb terminal approach. I’m running a python server on a Linux box (AWS EC2) that handles the request then constructs an OpenAI call from there, then passes the response back to the TRS-80.


Ah I see. So basically instead of a local Linux box you are piping it to an AWS instance with that card. This was what I was alluding to, in where you are just displaying the shell from the connected Linux host so you don't need to write any software on the TRS-80 itself:

https://arstechnica.com/information-technology/2015/08/surfi...


that is what it really is, a serial terminal.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: