Skip to main content

Public plugin contract for the NeMo Platform - the only package plugin authors need.

Project description

nemo-platform-plugin

License Python Docs

Build NeMo Platform plugins in Python.

nemo-platform-plugin is the only package plugin authors install. It re-exports every base class, schema, and helper you need to contribute HTTP services, CLI commands, schedulable jobs, background controllers, typed configuration, and entity types to NeMo Platform. Declare your surfaces in pyproject.toml, install the package, and the platform discovers and mounts them at startup — no registration code required.

What you can build

Surface Base class Entry-point group Purpose
HTTP service NemoService nemo.services Contributes FastAPI routers mounted at /apis/<name>/...
CLI NemoCLI nemo.cli Contributes nemo <name> <cmd> subcommands
Job NemoJob nemo.jobs Contributes schedulable, container-executable jobs. Auto-generates run / submit / explain CLI verbs.
Controller NemoController nemo.controllers Contributes background reconcile-loop controllers
Configuration NemoConfig Typed plugin configuration with env var / YAML loading
Entity NemoEntity Entity definitions stored in the NeMo Platform entity store

Install

pip install nemo-platform-plugin

To run a local NeMo Platform that loads and serves your plugin while you develop, install nemo-platform too — it ships the platform services, the nemo CLI, and the runtime that wires entity-client injection into your plugin's FastAPI app:

pip install "nemo-platform[all]"

A minimal plugin

A complete NeMo Platform plugin that contributes one HTTP route — a pyproject.toml and a service module:

# pyproject.toml
[project]
name = "nemo-my-plugin"
version = "0.1.0"
requires-python = ">=3.11"
dependencies = ["nemo-platform-plugin"]

[project.entry-points."nemo.services"]
"my-plugin" = "nemo_my_plugin.service:MyService"

# [build-system] is required by PEP 517 — without it, pip falls back to
# legacy setuptools. Any modern backend works; hatchling is what NeMo
# Platform itself uses and is the easiest fit for the src/ layout below.
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

# Required because the plugin uses a src/ layout with implicit namespace
# packages (no __init__.py). Hatchling needs to be told where the source is.
[tool.hatch.build.targets.wheel]
packages = ["src/nemo_my_plugin"]
# src/nemo_my_plugin/service.py
from typing import ClassVar

from fastapi import APIRouter
from nemo_platform_plugin.service import NemoService, RouterSpec


class MyService(NemoService):
    name: ClassVar[str] = "my-plugin"
    dependencies: ClassVar[list[str]] = []

    def get_routers(self) -> list[RouterSpec]:
        router = APIRouter()

        @router.get("/hello")
        async def hello() -> dict:
            return {"message": "Hello from my plugin!"}

        return [RouterSpec(router, tag="My Plugin")]

During development, nemo-platform-plugin is the only dependency your plugin needs. To actually run a local platform that loads your plugin, install nemo-platform[all] (see Install above), then:

pip install -e .
nemo services run
# GET http://localhost:8080/apis/my-plugin/hello → {"message": "Hello from my plugin!"}

That's a complete plugin. Adding a CLI command, a job, a controller, typed configuration, or entities follows the same shape — declare a class, register it under the matching entry-point group, install. See QUICKSTART for the full template covering every surface.

Guides

  • QUICKSTART — build your first plugin end-to-end (service + CLI + job + controller + config)
  • SERVICE — HTTP routes, CRUD patterns, testing
  • JOB — jobs, CLI commands, auto-generated job verbs
  • CONTROLLER — reconcile loops, state machines, service principal
  • CONFIG — typed configuration, env vars, YAML, test overrides
  • ENTITY — entity store, CRUD client, pagination, optimistic locking
  • INFERENCE_MIDDLEWARE — inference request/response middleware, typed bodies, response annotations
  • ARCHITECTURE — discovery, startup, all surfaces, SDK surface

Tip: These guides also ship inside the installed package at nemo_platform_plugin/docs/.

Links

License

nemo-platform-plugin is licensed under the Apache License 2.0. Third-party open-source dependencies have their own licenses; review them before use.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nemo_platform_plugin-0.1.2-py3-none-any.whl (1.9 MB view details)

Uploaded Python 3

File details

Details for the file nemo_platform_plugin-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for nemo_platform_plugin-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b49d817d7cb2975e82ca0e9f86485a943ab3e7219f6495d72e23380590d6c0ed
MD5 fc9d47e0081b9509dafd3b273d1320e9
BLAKE2b-256 38d7a6ea0df0782bd07ac701ed96044caf6749c3ade7b5e9243839541c847170

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page