Metadata-Version: 2.5
Name: oumigo
Version: 0.5.1
Summary: Vertical-integration toolkit for running and managing GPU fleets with vLLM and Transformer backends.
Project-URL: Homepage, https://github.com/gotoai/oumigo
Project-URL: Repository, https://github.com/gotoai/oumigo
Project-URL: Issues, https://github.com/gotoai/oumigo/issues
Author: GOTOAI
License-Expression: MIT
License-File: LICENSE
Keywords: cluster,inference,llm,serving,vllm
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Requires-Dist: fastapi>=0.110
Requires-Dist: httpx>=0.27
Requires-Dist: pydantic-settings>=2
Requires-Dist: pydantic>=2
Requires-Dist: pyyaml>=6
Requires-Dist: typer>=0.12
Requires-Dist: uvicorn>=0.29
Requires-Dist: websockets>=13
Requires-Dist: zeroconf>=0.130
Provides-Extra: conoha
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Provides-Extra: manager
Provides-Extra: worker
Requires-Dist: accelerate; extra == 'worker'
Requires-Dist: bitsandbytes; extra == 'worker'
Requires-Dist: pillow; extra == 'worker'
Requires-Dist: timm; extra == 'worker'
Requires-Dist: transformers<5.15,>=5.10.1; extra == 'worker'
Requires-Dist: vllm[audio]>=0.5; extra == 'worker'
Description-Content-Type: text/markdown

# OumiGo

OumiGo is a vertical-integration toolkit for running and managing **GPU fleets**.
A GPU fleet is a group of computer instances, running locally or on a cloud environment,
made up of a manager node and one or more GPU worker nodes coordinated
by the manager.

GPU worker nodes work independently as a whole to provide LLM based generation
capability, and the manager node exposes a unified data plane interface to calling
applications.

Key functions provided by an OumiGo fleet (as of v0.5.1):

1. Multiple GPU instance dynamic lifecycle management, supporting vLLM and Transformer backends
2. Data and control interfaces unification, runtime request routing
3. Several models in one fleet: each worker runs a catalog profile that fits its GPU,
   and clients choose a model by id
4. Performance monitoring
5. Remote workers on any vendor or site (RunPod, Vast.ai, other clouds, other on-prem
   sites) through a worker-initiated tunnel — no inbound ports or VPN on the GPU side;
   a ready worker image and a script that runs workers as RunPod pods
6. Vertical integration of administration and programming interfaces:
    - Command line interface (CLI) administration
    - Python API function with built-in Agent loop, supporting Agent chat, tool call usage
    - Python API interface for guardrail extension development



## Architecture

![OumiGo architecture: M agent applications talk to one manager (data plane, control plane, dashboard, provisioning) that coordinates N GPU workers.](https://raw.githubusercontent.com/gotoai/oumigo/main/docs/images/oumigo_architecture.png)

Two roles:

- **Manager** (`oumigo.service.manager`): coordinates the fleet, split into sub-layers:
  - **data plane / router** (`manager.router`): forwards client inference calls to
    healthy workers of the model each request names — on the hot path of every request. Exposes an **OpenAI-compatible**
    HTTP surface (`/v1/chat/completions`, `/v1/completions`, `/v1/models`, including SSE
    streaming), so any OpenAI-API client can talk to the fleet through a single endpoint.
  - **control plane** (`manager.control`): tracks worker registrations and state,
    drives worker lifecycle, reconciles desired vs. actual. Low-frequency,
    correctness-critical.
  - **dashboard** (`manager.dashboard`): performance & diagnostics — later.
  - **provisioning** (`oumigo.providers`): how workers come into existence — a
    minimal, lifecycle-shaped `Provider` protocol used by the control plane. Ships
    with `StaticProvider` in two postures: `LAN` (trusted local network) and `CUSTOM`
    (workers on any vendor or site, no vendor-specific processing; TLS and worker auth
    enforced). Workers are hand-started and self-register; cloud backends that
    provision through a vendor API are future implementations of the same protocol.
  - **transport** (per worker): `direct` (the router dials the worker) or `tunnel` (the
    worker dials out to the manager's `/tunnel` and the router borrows those
    connections) — see [docs/tunnel.md](docs/tunnel.md).
  - **model catalog** (`oumigo.config.catalog`): static profiles, one per model with all
    its start-time settings; the fleet allows some, each worker runs one — see
    [docs/model-catalog.md](docs/model-catalog.md).

  
- **Worker** (`oumigo.service.worker`): a long-lived *coordinator* supervises a LLM server
  as a child process, monitors health, executes start/stop/restart from the manager,
  and owns the node state machine + restart-with-give-up policy. Workers self-register
  with the manager and heartbeat.

Programming interfaces layered on top of the two roles:

- **Python API** (`oumigo.api`): the client-side inference layer. `Agent(tools)` → `Chat`
  → `request` drives a built-in agent loop with callback tools, response parity across
  streaming/non-streaming, and reasoning-content surfacing. Talks to the manager's data
  plane so applications never address workers directly.
- **Guardrails** (`oumigo.guard`): an agent-layer interceptor chain with a narrow-waist
  `Guard` protocol and tiered rule→model add-ins, for developing guardrail extensions
  around the API without touching fleet internals.

Shared foundations: `oumigo.config` (typed settings + precedence resolution) and
`oumigo.protocol` (the wire contract both roles import so it can't drift).

### Using the fleet as an OpenAI-compatible endpoint

Because the data plane speaks the OpenAI API, the manager can drop in wherever an
OpenAI-compatible base URL is accepted — no OumiGo client required. Point the tool at the
manager's router and it addresses the whole fleet through one endpoint:

```
Base URL:  http://<manager-host>:<router-port>/v1
Model:     a model id from GET /v1/models, or any-model
API key:   a client API key (`oumigo manager apikey create`) when client auth is on, which
           it always is under provider CUSTOM; otherwise any non-empty string
```

This has been verified with other editing or coding assistant agents, and works the same
for any OpenAI-API SDK or tool (e.g. the `openai` Python client).

## Installation

OumiGo is published on [PyPI](https://pypi.org/project/oumigo/). Install the extra that
matches the node's role:

```bash
pip install "oumigo[worker]"     # on a GPU worker box (pulls vLLM + Transformers)
pip install "oumigo[manager]"    # on the manager box
oumigo version
```

> On a GPU worker box, do **not** install `torch` separately — vLLM hard-pins it and pulls
> the matching CUDA wheel transitively.

To use OumiGo from another project, add it as a dependency (`pip install oumigo`, or the
`[worker]` / `[manager]` extra as needed).

## Development

Working on OumiGo itself uses an editable install from a source checkout:

```bash
# from oumigo/
python -m venv .venv
source .venv/bin/activate
pip install -e ".[worker,dev]"     # on a GPU worker box
pip install -e ".[manager,dev]"    # on the manager box
oumigo version
```

## Documentation

- [docs/api.md](docs/api.md) — Python API: Agent loop, chat, tool calls, streaming.
- [docs/metrics.md](docs/metrics.md) — performance monitoring and metrics.
- [docs/worker-node-states.md](docs/worker-node-states.md) — worker node state machine.
- [docs/tunnel.md](docs/tunnel.md) — remote workers: CUSTOM provider, tunnel transport, nginx deployment, join tokens.
- [docs/deploy-custom-providers-with-tunnel.md](docs/deploy-custom-providers-with-tunnel.md) — step by step: manager on a VPS, GPU workers behind NAT, clients with API keys.
- [docs/model-catalog.md](docs/model-catalog.md) — several models in one fleet: profiles, the catalog, choosing a model (worker and client), upgrading from 0.4.
- [docs/runpod.md](docs/runpod.md) — the worker Docker image and running workers as RunPod pods, by hand or on a schedule.
