Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Hermes Retro-Bridge (Classic Mac OS Edition)

A lightweight, zero-dependency Python asynchronous bridge that allows vintage Macintosh computers (running System 7, 8, or 9) to communicate natively with modern Hermes Agent Gateways and OpenAI-compatible AI endpoints.

Credits & Tribute

This project is a dedicated companion to MacinAI, the groundbreaking software developed by Alex Hoopes.

Alex’s work has been instrumental in breathing new life into vintage hardware, proving that even a Macintosh from 1991 can participate in the modern AI revolution. This bridge was built by reverse-engineering the protocol requirements of MacinAI to allow users to host their own backends via the Hermes Agent ecosystem (Nous Research).

Special thanks to the Vintage Mac community at OldAppleStuff.com and the hobbyists who keep the spirit of 68k and PowerPC computing alive.

The Breakthrough: Protocol Spoofing

MacinAI is a highly optimized client designed to interface with a specific server architecture. Through raw byte-probing of legacy traffic, this bridge was designed to mirror the exact state-tracking payload required by MacinAI's C-string parser.

Returning raw text strings typically results in the client hanging or returning "No message in response." This bridge solves that by translating your prompt to Hermes and then wrapping the response in a "spoofed" database entry that the Mac understands:

SUCCESS:TIME=YYYY-MM-DD HH:MM:SS UTC:USER_SEQ=X:AI_SEQ=Y:UPDATED=YYYY-MM-DD HH:MM:SS UTC:MSG=Your response here\n

Architecture

[ Vintage Mac (MacinAI) ]
│ (Raw TCP / MacRoman / Colon-Talk)

[ Python Retro-Bridge (Port 9999) ]
│ (JSON REST API / Bearer Auth)

[ Hermes Agent Gateway (Port 8642) ]

Features

  • MacinAI Compatibility: Specifically tuned to satisfy the internal synchronization requirements of Alex Hoopes' client.
  • Zero Dependencies: Uses only standard Python built-in libraries (asyncio, urllib, json, datetime).
  • Context Injection: Auto-injects system instructions so the modern LLM understands hardware constraints (plain text only, strict word counts, no markdown/emojis).
  • Character Map Protection: Handles text encoding conversions (utf-8 to mac_roman) and sanitizes syntax-breaking characters like unescaped colons.

Prerequisites

  1. A vintage Macintosh running MacinAI (configured to point to your bridge machine's IP on port 9999).
  2. Python 3.9+ running on your host machine.
  3. A running instance of the Hermes Agent Gateway with its API server enabled.

Configuration

1. Enable the Hermes Gateway API Server

Add the following entries to your ~/.hermes/.env file:

API_SERVER_ENABLED=true
API_SERVER_KEY=classic-mac
API_SERVER_PORT=8642

Restart your gateway:

hermes gateway stop
hermes gateway

2. Configure the Bridge Script

Adjust the configuration block at the top of bridge_hybrid.py if necessary:

HERMES_GATEWAY_URL = "[http://127.0.0.1:8642/v1/chat/completions\](http://127.0.0.1:8642/v1/chat/completions)"
API_KEY = "classic-mac"
MODEL_NAME = "hermes-agent"

Usage

Run the bridge:

python3 bridge_hybrid.py

In the MacinAI client on your vintage Mac, set the server address to your host machine's local IP address and start chatting.

License

No License. This code is provided as-is for the retro-computing community to use, modify, and share freely. Long live the Mac.

About

A protocol translation proxy connecting the vintage MacinAI client (Classic Mac OS 7/8/9) to modern Hermes Agent Gateways and OpenAI-compatible APIs.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages