signebedi / gptty

ChatGPT wrapper in your TTY
MIT License
48 stars 7 forks source link

[daemon] write a listener daemon to monitor a question queue #18

Open signebedi opened 1 year ago

signebedi commented 1 year ago

write a listener daemon to monitor a question queue It may make sense to daemonize a listener interface that synchronously processes questions in a spool file. Potentially, then, the chat client runs its request asynchronously and awaits a response from the listener daemon.

Originally posted by @signebedi in https://github.com/signebedi/gptty/issues/17#issuecomment-1481473575

signebedi commented 1 year ago

It will be worth asking how this will work with pypi installations. I think that a daemon interface should be configurable in gptty.ini (see example below) but the runtime should fall back on its own synchronous function set if no daemon is provided.

[main]
enable_daemon=1
daemon_host=localhost
daemon_port=9214
signebedi commented 1 year ago

I'm imagining we run this as a systemd service... is there an easy way to do so using gptty? For example, we maybe create a click command gptty serve --host localhost --port 9214 that runs listener server. Or, we optionally run it with a --daemonize tag so it doesn't expect to be in the foreground. Then, we provide a systemd example in assets/...