GENAI Login
A desktop VS Code extension that connects local OpenAI-compatible clients to the University of Macau's GENAI service. This is an independent community project. It requires an authorized UMPASS account, uses the university's normal sign-in and phone MFA, and is subject to the service's usage policies.
User guide | Pricing reference | Changelog | MIT license
Quick start
- Install GENAI Login by Petalzu in desktop VS Code 1.110 or later. Install Microsoft Edge on the same machine. Node.js and npm are not required for users.
- Open GENAI Login and choose Save account and password. For Copilot, run GENAI Login: Manage Copilot models to add chat presets to the current Profile. Changes require confirmation and create a backup.
- Send a request and complete any MFA on your phone. The first request waits for authentication; concurrent requests share the same login. To connect ahead of time, run GENAI Login: Login and connect.
For other clients, set the base URL to http://127.0.0.1:58379/v1 (use your configured port) and the API key to local-browser-session.
| Endpoint |
Behavior |
GET /v1/models |
Lists bundled presets on standby without logging in; uses the upstream list when connected. |
POST /v1/chat/completions |
Forwards chat, including streaming responses, tool calls and reported usage. Cancelling a client stops its request, not another client's login or stream. |
POST /v1/images/generations |
Returns data[].b64_json; at most six images and 20 MiB of decoded image data per request. |
The image API is available to direct clients. Marketplace handles updates; 0.0.16 was the final GitHub Release.
Operation and limits
- The bridge runs on the VS Code client machine, including during Remote-SSH sessions. It accepts authenticated loopback requests, rejects browser origins, and must not be exposed to untrusted networks. Its fixed compatibility key does not protect against other local programs.
- One editor or Agents window owns the port. Other windows in the same Profile can control it. An open peer can verify a saved session on handover; if the owner closed during MFA, reconnect explicitly. Closing every window stops the service. Reload all participating windows after an update.
- Standby does not start Edge or read credentials. Credentials and cookies use VS Code SecretStorage; clearing them does not revoke the upstream session. Partial generations are not replayed automatically. See session health and troubleshooting for cooldowns, retry hints and recovery.
- History uses independent per-window records. Missing usage is unknown, not zero; reference costs are not bills. Non-streaming responses over 2 MiB still reach the client, but their JSON is not parsed for usage.
Settings
All keys below are prefixed with genai-login.. Reload participating windows after changing the port or admission limits; update client URLs after a port change.
| Key |
Default |
Meaning |
port |
58379 |
Loopback port (1024-65535). |
idleTimeoutSeconds |
0 |
Upstream inactivity timeout for new requests; 0 disables it. Paused during authentication. |
maxConcurrentRequests |
32 |
Active requests, including login waits and streaming. |
maxQueuedRequests |
64 |
FIFO waiting slots; excess requests receive 503 with Retry-After. |
maxBufferedRequestMiB |
128 |
Request-body reservation, including assembly copies; not a process memory cap. Individual uploads are limited to 20 MiB. |
queueTimeoutSeconds |
60 |
Maximum wait for admission, separate from login and upstream timeouts. |
Development
Use Node.js 24 and npm. Install dependencies with npm ci and keep the Playwright runtime assets external when bundling. The production entry is dist/extension.js; edit source files, not generated bundles.
| Area |
Source |
| Listener, activation, cross-window control |
extension.js, shared-control.js |
| Authentication, cookies and Edge helper |
auth.js, browser-auth.js, auth-forms.js |
| Forwarding, cancellation and admission |
bridge-stream.js, upstream.js |
| Usage, history and dashboard |
stats.js, dashboard.js |
| Client configuration |
copilot-config.js, copilot-models.js |
| Command |
What it checks |
npm run lint |
Source, test and build scripts; warnings fail the check. |
npm run build |
Production bundles and third-party notices. |
npm test |
Lint, build, Node unit and loopback integration tests, intercepted Edge flows and VS Code extension-host tests. |
npm run bench |
Build and measure large JSON inspection and eight concurrent SSE streams. Reports warm medians and verifies streamed bytes and usage; no university traffic or timing threshold. |
Test files run serially so desktop fixtures do not compete for startup; concurrency tests still issue parallel requests. Set GENAI_TEST_VSCODE_PATH to a local VS Code executable supporting --agents to include the installed-fixture editor/Agents handover test. GENAI_TEST_EXTENSION_PATH optionally points it to a prepared beta fixture. Set GENAI_TEST_AGENTS=1 for npx --no-install vscode-test to run the host suite in an empty Agents window. Host tests use isolated data and an available loopback port. The browser fixtures do not verify live university availability or MFA.
For issues, include the extension and VS Code versions, expected behavior and sanitized diagnostics. Never include credentials, cookies, callback URLs or conversation content.