# openeverest/provider-kserve architecture

> Architecture diagram of the GitHub repository openeverest/provider-kserve, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/openeverest/provider-kserve
- Repository: https://github.com/openeverest/provider-kserve

## Overview

#### Purpose and Runtime Entry Point
This Go provider is an OpenEverest extension that translates technology-agnostic `Instance` CRs into KServe resources. It watches only Instances referring to `provider-kserve`; KServe controllers, not this provider, create and operate workloads. The executable entry point is `cmd/provider/main.go`; provider lifecycle implementation is under `internal/provider/provider.go`.

#### Provider Contract and Reconciliation Boundary
The provider SDK invokes validation, sync, status, and cleanup for matching Instances. Reconciliation creates/updates provider-owned KServe and supporting Kubernetes CRs, then derives health and connection information back into `Instance.status`. It deliberately does not manage Pods, Deployments, HPAs, or model storage directly.
- `internal/provider/provider.go`
- `internal/provider/inferenceservice.go`
- `internal/common/apply.go`

#### Declarative Provider API
Provider identity, supported component types, topology schemas, UI-facing metadata, and version bundles are defined declaratively, then generated into the installed Provider specification. Two non-default topologies are supported: `llm` and `predictor`.
- `definition/provider.yaml`
- `definition/topologies/llm/topology.yaml`
- `definition/versions.yaml`

#### LLM Translation Path
For `llm` Instances, the provider maps the `llmEngine` component and topology parameters to KServe `LLMInferenceService` resources. It composes model URI, vLLM parallelism, resource guarantees, compute profiles, optional inline `LLMInferenceServiceConfig`, LoRA validation/catalog data, and KServe config references. Inline configs are owned by the Instance and applied after shared/preset references.
- `internal/provider/llminferenceservice.go`
- `definition/topologies/llm/types.go`
- `internal/common/lora_catalog.go`

#### Predictor Translation Path
For `predictor` Instances, the provider creates KServe `InferenceService` resources in Standard deployment mode. Model format/storage URI select or pin KServe serving runtimes; replica and resource settings become predictor configuration. Runtime selection and actual Deployment/HPA lifecycle remain KServe responsibilities.
- `internal/provider/inferenceservice.go`
- `definition/topologies/predictor/types.go`
- `definition/components/types.go`

#### Access, Gateway, and Observability Resources
LLM reconciliation may create provider-owned exposure resources: LoadBalancer/NodePort Services, Envoy AI Gateway routes, and optional token-quota policy wiring. It can also create a per-instance Prometheus `PodMonitor`; absence of monitoring CRDs is handled safely. Gateway routing and direct KServe access are separate paths.
- `internal/provider/aigateway.go`
- `internal/provider/podmonitor.go`
- `charts/provider-kserve/templates/ai-gateway.yaml`

#### Installation Stack and External Dependencies
The Helm chart deploys the provider Deployment/RBAC/Provider CR and bundles KServe controller dependencies, KServe CRDs, runtime configs, and LLM presets. KServe runs in Standard mode. cert-manager is required for KServe admission-webhook certificates. Optional Envoy AI Gateway depends on external LoadBalancer provisioning; quotas require a Redis/Valkey-compatible backend. Models are fetched by KServe from `hf://`, `s3://`, `gs://`, or `pvc://` URIs.
- `charts/provider-kserve/Chart.yaml`
- `charts/provider-kserve/templates/deployment.yaml`
- `charts/provider-kserve/files/llmisvcconfigs/resources.yaml`

#### Generated Assets and Development Environment
`gen.go` and the Makefile produce the provider spec, RBAC, chart-generated files, vendored presets, and dependency synchronization. Local development runs against Kubernetes, commonly k3d, through Tilt; production packaging is a Helm OCI chart published through GitHub workflows.
- `gen.go`
- `config/rbac/role.yaml`
- `dev/Tiltfile`

Main entry points: [`internal/provider/provider.go`](https://github.com/openeverest/provider-kserve/blob/main/internal/provider/provider.go) (Provider lifecycle), [`internal/common/apply.go`](https://github.com/openeverest/provider-kserve/blob/main/internal/common/apply.go) (Owned resource apply), [`internal/provider/llminferenceservice.go`](https://github.com/openeverest/provider-kserve/blob/main/internal/provider/llminferenceservice.go) (LLM translator), [`internal/provider/aigateway.go`](https://github.com/openeverest/provider-kserve/blob/main/internal/provider/aigateway.go) (Gateway exposure)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_provider["Provider runtime"]
  node_entrypoint["Provider executable<br/>Go entry point<br/>[main.go]"]
  node_lifecycle["Provider lifecycle<br/>SDK reconciliation<br/>[provider.go]"]
  node_apply["Owned resource apply<br/>Kubernetes apply<br/>[apply.go]"]
  node_status["Instance status<br/>connection and health"]
end

subgraph group_definitions["Provider API"]
  node_provider_definition["Provider definition<br/>declarative API<br/>[provider.yaml]"]
  node_llm_schema["LLM topology schema<br/>topology types<br/>[topology.yaml]"]
  node_versions["Version bundles<br/>version metadata<br/>[versions.yaml]"]
end

subgraph group_translation["Topology translation"]
  node_llm_translation["LLM translator<br/>LLMInferenceService builder"]
  node_lora_catalog["LoRA catalog<br/>validation data<br/>[lora_catalog.go]"]
  node_predictor_translation["Predictor translator<br/>InferenceService builder"]
  node_gateway_resources["Gateway exposure<br/>[aigateway.go]"]
  node_monitoring["PodMonitor<br/>Prometheus CR<br/>[podmonitor.go]"]
end

subgraph group_delivery["Installation and delivery"]
  node_helm_chart["Helm chart<br/>installation package<br/>[Chart.yaml]"]
  node_generation["Generation pipeline<br/>Go generation and Make<br/>[gen.go]"]
  node_local_dev["Local development<br/>Tilt on Kubernetes"]
end

subgraph group_external["Platform dependencies"]
  node_instance["OpenEverest Instance<br/>custom resource"]
  node_kserve_resources["KServe resources<br/>LLMInferenceService and InferenceService"]
  node_kserve{{"KServe controllers<br/>workload controller"}}
  node_model_storage[("Model storage<br/>model URI backends")]
  node_gateway_platform{{"Envoy AI Gateway<br/>external gateway"}}
  node_quota_backend[("Redis or Valkey<br/>quota backend")]
end

node_entrypoint -->|"starts"| node_lifecycle
node_instance -->|"SDK invokes for matching provider"| node_lifecycle
node_lifecycle -->|"llm topology"| node_llm_translation
node_lifecycle -->|"predictor topology"| node_predictor_translation
node_lifecycle -->|"derives health and connection"| node_status
node_llm_translation -->|"validates LoRA"| node_lora_catalog
node_llm_translation -->|"applies owned resources"| node_apply
node_predictor_translation -->|"applies owned resources"| node_apply
node_gateway_resources -->|"applies optional exposure"| node_apply
node_monitoring -.->|"applies when CRD exists"| node_apply
node_apply -->|"creates or updates"| node_kserve_resources
node_kserve_resources -->|"reconciled by"| node_kserve
node_kserve -->|"fetches models"| node_model_storage
node_llm_translation -.->|"optional exposure"| node_gateway_resources
node_gateway_resources -->|"routes through"| node_gateway_platform
node_gateway_resources -.->|"quota policy backend"| node_quota_backend
node_provider_definition -->|"declares topology"| node_llm_schema
node_provider_definition -->|"uses bundles"| node_versions
node_generation -->|"generates installed spec"| node_provider_definition
node_generation -->|"generates packaged assets"| node_helm_chart
node_helm_chart -->|"deploys"| node_entrypoint
node_helm_chart -->|"bundles dependencies"| node_kserve
node_local_dev -.->|"develops against Kubernetes"| node_helm_chart

click node_entrypoint "https://github.com/openeverest/provider-kserve/blob/main/cmd/provider/main.go"
click node_lifecycle "https://github.com/openeverest/provider-kserve/blob/main/internal/provider/provider.go"
click node_apply "https://github.com/openeverest/provider-kserve/blob/main/internal/common/apply.go"
click node_provider_definition "https://github.com/openeverest/provider-kserve/blob/main/definition/provider.yaml"
click node_llm_schema "https://github.com/openeverest/provider-kserve/blob/main/definition/topologies/llm/topology.yaml"
click node_versions "https://github.com/openeverest/provider-kserve/blob/main/definition/versions.yaml"
click node_llm_translation "https://github.com/openeverest/provider-kserve/blob/main/internal/provider/llminferenceservice.go"
click node_lora_catalog "https://github.com/openeverest/provider-kserve/blob/main/internal/common/lora_catalog.go"
click node_predictor_translation "https://github.com/openeverest/provider-kserve/blob/main/internal/provider/inferenceservice.go"
click node_gateway_resources "https://github.com/openeverest/provider-kserve/blob/main/internal/provider/aigateway.go"
click node_monitoring "https://github.com/openeverest/provider-kserve/blob/main/internal/provider/podmonitor.go"
click node_helm_chart "https://github.com/openeverest/provider-kserve/blob/main/charts/provider-kserve/Chart.yaml"
click node_generation "https://github.com/openeverest/provider-kserve/blob/main/gen.go"
click node_local_dev "https://github.com/openeverest/provider-kserve/blob/main/dev/Tiltfile"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entrypoint,node_lifecycle,node_apply,node_status toneBlue
class node_provider_definition,node_llm_schema,node_versions toneAmber
class node_llm_translation,node_lora_catalog,node_predictor_translation,node_gateway_resources,node_monitoring toneMint
class node_helm_chart,node_generation,node_local_dev toneRose
class node_instance,node_kserve_resources,node_kserve,node_model_storage,node_gateway_platform,node_quota_backend toneIndigo
```

## Components

### Provider runtime

Translates matching OpenEverest Instances into KServe CRs.

- [Provider executable](https://github.com/openeverest/provider-kserve/blob/main/cmd/provider/main.go): Go entry point · `cmd/provider/main.go`
- [Provider lifecycle](https://github.com/openeverest/provider-kserve/blob/main/internal/provider/provider.go): SDK reconciliation · Validates, syncs, reports status, and cleans up matching Instances. · `internal/provider/provider.go`
- [Owned resource apply](https://github.com/openeverest/provider-kserve/blob/main/internal/common/apply.go): Kubernetes apply · `internal/common/apply.go`
- **Instance status**: connection and health

### Provider API

Declarative identity, schemas, and version metadata.

- [Provider definition](https://github.com/openeverest/provider-kserve/blob/main/definition/provider.yaml): declarative API · Defines identity, component support, metadata, and generated specification. · `definition/provider.yaml`
- [LLM topology schema](https://github.com/openeverest/provider-kserve/blob/main/definition/topologies/llm/topology.yaml): topology types · `definition/topologies/llm/topology.yaml`
- [Version bundles](https://github.com/openeverest/provider-kserve/blob/main/definition/versions.yaml): version metadata · `definition/versions.yaml`

### Topology translation

Topology-specific KServe resource construction.

- [LLM translator](https://github.com/openeverest/provider-kserve/blob/main/internal/provider/llminferenceservice.go): LLMInferenceService builder · Builds model, vLLM, resources, config, and LoRA inputs. · `internal/provider/llminferenceservice.go`
- [LoRA catalog](https://github.com/openeverest/provider-kserve/blob/main/internal/common/lora_catalog.go): validation data · `internal/common/lora_catalog.go`
- [Predictor translator](https://github.com/openeverest/provider-kserve/blob/main/internal/provider/inferenceservice.go): InferenceService builder · Maps model and replica settings to Standard-mode predictors. · `internal/provider/inferenceservice.go`
- [Gateway exposure](https://github.com/openeverest/provider-kserve/blob/main/internal/provider/aigateway.go): Service and AI Gateway routes · Optional direct Services, routes, and token-quota wiring. · `internal/provider/aigateway.go`
- [PodMonitor](https://github.com/openeverest/provider-kserve/blob/main/internal/provider/podmonitor.go): Prometheus CR · Optional per-instance monitoring when its CRD exists. · `internal/provider/podmonitor.go`

### Installation and delivery

Helm installation, generation, and local development.

- [Helm chart](https://github.com/openeverest/provider-kserve/blob/main/charts/provider-kserve/Chart.yaml): installation package · Deploys provider, RBAC, Provider CR, KServe dependencies, configs, and presets. · `charts/provider-kserve/Chart.yaml`
- [Generation pipeline](https://github.com/openeverest/provider-kserve/blob/main/gen.go): Go generation and Make · Produces spec, RBAC, chart files, presets, and synchronized dependencies. · `gen.go`
- [Local development](https://github.com/openeverest/provider-kserve/blob/main/dev/Tiltfile): Tilt on Kubernetes · `dev/Tiltfile`

### Platform dependencies

Controllers and optional services operated outside the provider.

- **OpenEverest Instance**: custom resource · Only Instances referring to provider-kserve are reconciled.
- **KServe resources**: LLMInferenceService and InferenceService · Provider-owned CRs consumed by KServe controllers.
- **KServe controllers**: workload controller · Creates and operates serving workloads in Standard mode.
- **Model storage**: model URI backends · KServe fetches hf, S3, GCS, or PVC models.
- **Envoy AI Gateway**: external gateway · Requires external LoadBalancer provisioning.
- **Redis or Valkey**: quota backend

## Connections

- Provider executable → Provider lifecycle: starts
- OpenEverest Instance → Provider lifecycle: SDK invokes for matching provider
- Provider lifecycle → LLM translator: llm topology
- Provider lifecycle → Predictor translator: predictor topology
- Provider lifecycle → Instance status: derives health and connection
- LLM translator → LoRA catalog: validates LoRA
- LLM translator → Owned resource apply: applies owned resources
- Predictor translator → Owned resource apply: applies owned resources
- Gateway exposure → Owned resource apply: applies optional exposure
- PodMonitor → Owned resource apply: applies when CRD exists
- Owned resource apply → KServe resources: creates or updates
- KServe resources → KServe controllers: reconciled by
- KServe controllers → Model storage: fetches models
- LLM translator → Gateway exposure: optional exposure
- Gateway exposure → Envoy AI Gateway: routes through
- Gateway exposure → Redis or Valkey: quota policy backend
- Provider definition → LLM topology schema: declares topology
- Provider definition → Version bundles: uses bundles
- Generation pipeline → Provider definition: generates installed spec
- Generation pipeline → Helm chart: generates packaged assets
- Helm chart → Provider executable: deploys
- Helm chart → KServe controllers: bundles dependencies
- Local development → Helm chart: develops against Kubernetes
