Where JavaScript, Python, and AI agents speak the same language
Project description
Where JavaScript, Python, and AI agents speak the same language.
Real-time JS ↔ Python commands, AI-debuggable sessions, and MCP control — out of the box.
LLMing-Com connects JavaScript frontends to Python backends over WebSockets with structured commands, session management, cookie-based authentication, and a debug API that AI agents can use to inspect and control running applications.
Why?
- WS-first UI traffic --
SessionRouterandAppRoutergive you FastAPI-style namespaced dispatch for WebSocket JSON messages. One socket carries every UI command and query. - AI controls and debugs your app -- The debug API and
@commanddecorator expose a parallel HTTP/MCP surface for AI agents and tooling, separate from the UI socket. - One decorator, one debug command -- Define a debug/admin command once with
@command; get an HTTP endpoint, JSON schema, and MCP tool for free. - Sessions just work -- Type-safe registry with TTL cleanup, WebSocket lifecycle management, and connection superseding built in.
Transport Policy
Two surfaces, two router types -- pick by audience, not by preference:
| Audience | Transport | Router | Used for |
|---|---|---|---|
| UI / app frontend | WebSocket | SessionRouter |
Per-user command and query traffic between the live frontend and backend |
| UI / app frontend | WebSocket | AppRouter |
App-wide commands with a typed app context |
| AI agents, MCP clients, ops tools | HTTP | build_command_router / build_debug_router |
Debug/admin surface: session inspection, ws_send forwarding, @command-decorated debug actions |
| Anyone | HTTP | (your own FastAPI routes) | Large or static content only -- file uploads, blob downloads, asset serving |
Do not add HTTP routes for UI commands -- those belong on SessionRouter or AppRouter. Do not push large blobs through the WS message pipe -- those belong on plain HTTP endpoints. The @command framework is for the debug/admin surface; it is not a UI command system.
Features
- HMAC-SHA256 cookie authentication (session + identity tokens with expiry)
- Generic session registry with singleton pattern and TTL cleanup
- One central
LlmingSessiontype with typed, lazily-created session data attachments - WebSocket transport with connection superseding and rate limiting
SessionRouter/AppRouter-- typed namespaced dispatch for WS messages, nestable viainclude(), auto-replies with_req_idmatching- JavaScript client with auto-reconnect, heartbeat, and session-loss detection (framework-agnostic)
- Declarative
@commandframework for the debug/admin surface, with auto-generated REST + MCP endpoints - Debug API with IP whitelisting, audit logging, and trusted proxy support
- Thread-safe in-memory data store with namespace isolation
- Mock auth system for headless and E2E testing
- MCP server (HTTP/SSE + stdio) for AI agent integration
Usage
Runnable examples live in samples/:
basic_session.py— central sessions and typed data attachmentsauth_demo.py— HMAC tokens, identity tokens, tamper detectionwebsocket_server.py— FastAPI WebSocket app with debug routerdemo_app.py— full interactive demo with the@commandframework and the JavaScript client
Run any sample with LLMING_AUTH_SECRET=demo PYTHONPATH=. python samples/<name>.py.
Project Structure
llming_com/ Core library (auth, session, transport, commands, debug, data store)
llming_com/static/ JavaScript client (LlmingWebSocket)
tests/ Pytest suite
samples/ Example applications (run with: LLMING_AUTH_SECRET=demo python samples/demo_app.py)
docs/ Documentation and assets
Development
git clone https://github.com/Alyxion/llming-com.git
cd llming-com
poetry install
LLMING_AUTH_SECRET=dev-secret pytest tests/ -q
License
MIT -- Copyright 2026 Michael Ikemann
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llming_com-0.1.7.tar.gz.
File metadata
- Download URL: llming_com-0.1.7.tar.gz
- Upload date:
- Size: 38.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.13.11 Darwin/25.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
657287902ea4a7f7e52b659a0a283949f53dcfd9c134b991329dbbc1d239514a
|
|
| MD5 |
1a4d64fbc0e12eced83aa2277361024a
|
|
| BLAKE2b-256 |
38308be3eb78045253f6f43c606e38cebce3e24bd34a067180ec91c1f5310ad3
|
File details
Details for the file llming_com-0.1.7-py3-none-any.whl.
File metadata
- Download URL: llming_com-0.1.7-py3-none-any.whl
- Upload date:
- Size: 46.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.13.11 Darwin/25.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da127690d5f75b59727a6ba2ade3507085fe7f2a7b3520a51674a3dbb1ef3f76
|
|
| MD5 |
3847639a7f728c1892479761954fbcc0
|
|
| BLAKE2b-256 |
946afec62426b4fc3d4ba0b7bd6c3051e1b5dbaec2db943fd402f543170d2828
|