logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Model Orchestration Gateway (MOG)

Facilitates integration of the Protocol for Model Command (PMC) with OpenAI's inference endpoint, enabling external utility invocation via a containerized execution environment. Supports dynamic dispatch of capabilities and data retrieval predicated on user inputs.

Author

Model Orchestration Gateway (MOG) logo

TomasRodriguez2002

MIT License

Quick Info

GitHub GitHub Stars 0
NPM Weekly Downloads 0
Tools 1
Last Updated 2026-02-19

Tags

apisapiopenaiopenai apimcp openaiapis http

Containerized PMC Execution Engine

This repository illustrates how to bridge the Model Command Protocol (PMC) with the capabilities of OpenAI's service, allowing the LLM to leverage utilities exposed by a PMC engine operating within a Docker container.

Prerequisites

  • A functional Docker installation on your host system
  • Git version control utility (for repository cloning)

Component Layout

  • server.py: Contains the PMC engine logic and utility definitions
  • client.py: Script for establishing connection to the engine and invoking the agent
  • Dockerfile: Blueprint for constructing the necessary container image
  • requirements.txt: List of Python packages essential for the project

Operational Sequence Detail

  1. Inquiry Submission: The user presents a prompt to the system (e.g., "What is the established protocol for employee leave?")
  2. OpenAI Processing: OpenAI ingests the prompt alongside the exposed utility descriptions from the PMC gateway.
  3. Capability Selection: The model determines the most appropriate utility (or utilities) to address the prompt.
  4. PMC Invocation Relay: The client component receives the designated utility call instruction from OpenAI and relays it to the PMC engine.
  5. Engine Execution: The PMC engine executes the designated function (e.g., querying an internal repository).
  6. Result Forwarding: The output generated by the utility travels back via the client interface to the OpenAI service.
  7. Final Synthesis: OpenAI formulates the conclusive answer, incorporating the retrieved utility data.

Deployment Via Docker

Phase 1: Image Construction

docker build -t mog-service .

Phase 2: Container Launch

docker run -p 8050:8050 mog-service

This command initializes the PMC engine within a sandboxed container, making its interface available externally on TCP port 8050.

Client Execution

Once the service is confirmed operational, execute the client script in a separate terminal session:

python client.py

The client will establish a connection, enumerate available functions, and initiate the agent process to resolve the initial query.

Diagnostic Guidance

If connectivity challenges arise:

  1. Service Status Verification: Confirm the container is active using docker ps.

  2. Port Mapping Validation: Review the output of docker ps or the docker run command summary to confirm correct port forwarding.

  3. Engine Log Inspection: Examine container outputs via docker logs <container_identifier> for runtime errors.

  4. Interface Binding: The engine is bound to 0.0.0.0 for external access. If issues persist, examine local firewall configurations.

  5. Network Topology: If the Docker host is remote, ensure that port 8050 is reachable from the client machine's network segment.

Remarks

  • The communication layer utilizes Server-Sent Events (SSE) streaming, listening specifically on port 8050.
  • The client targets the endpoint at http://localhost:8050/sse.
  • Confirm the engine is fully initialized before attempting to run the client application.

See Also

`