MCPcopy Index your code
hub / github.com/InftyAI/llmaz

github.com/InftyAI/llmaz @v0.1.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.4 ↗ · + Follow
867 symbols 2,262 edges 160 files 478 documented · 55%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README
<img alt="llmaz" src="https://raw.githubusercontent.com/inftyai/llmaz/main/site/static/images/logo.png" width=55%>

Easy, advanced inference platform for large language models on Kubernetes

stability-alpha GoReport Widget Latest Release

llmaz (pronounced /lima:z/), aims to provide a Production-Ready inference platform for large language models on Kubernetes. It closely integrates with the state-of-the-art inference backends to bring the leading-edge researches to cloud.

🌱 llmaz is alpha now, so API may change before graduating to Beta.

Overview

<img alt="infrastructure" src="https://raw.githubusercontent.com/inftyai/llmaz/main/site/static/images/infra.png" width=70%>

Architecture

<img alt="architecture" src="https://raw.githubusercontent.com/inftyai/llmaz/main/site/static/images/arch.png" width=100%>

Key Features

  • Easy of Use: People can quick deploy a LLM service with minimal configurations.
  • Broad Backends Support: llmaz supports a wide range of advanced inference backends for different scenarios, like vLLM, Text-Generation-Inference, SGLang, llama.cpp, TensorRT-LLM. Find the full list of supported backends here.
  • Heterogeneous Cluster Support: llmaz supports serving the same LLM with heterogeneous devices together with InftyAI Scheduler for the sake of cost and performance.
  • Various Model Providers: llmaz supports a wide range of model providers, such as HuggingFace, ModelScope, ObjectStores. llmaz will automatically handle the model loading, requiring no effort from users.
  • Distributed Inference: Multi-host & homogeneous xPyD support with LWS from day 0. Will implement the heterogeneous xPyD in the future.
  • AI Gateway Support: Offering capabilities like token-based rate limiting, model routing with the integration of Envoy AI Gateway.
  • Scaling Efficiency: Horizontal Pod scaling with HPA with LLM-based metrics and node(spot instance) autoscaling with Karpenter.
  • Build-in ChatUI: Out-of-the-box chatbot support with the integration of Open WebUI, offering capacities like function call, RAG, web search and more, see configurations here.

Quick Start

Installation

Read the Installation for guidance.

Deploy

Here's a toy example for deploying facebook/opt-125m, all you need to do is to apply a Model and a Playground.

If you're running on CPUs, you can refer to llama.cpp.

Note: if your model needs Huggingface token for weight downloads, please run kubectl create secret generic modelhub-secret --from-literal=HF_TOKEN=<your token> ahead.

Model

apiVersion: llmaz.io/v1alpha1
kind: OpenModel
metadata:
  name: opt-125m
spec:
  familyName: opt
  source:
    modelHub:
      modelID: facebook/opt-125m
  inferenceConfig:
    flavors:
      - name: default # Configure GPU type
        limits:
          nvidia.com/gpu: 1

Inference Playground

apiVersion: inference.llmaz.io/v1alpha1
kind: Playground
metadata:
  name: opt-125m
spec:
  replicas: 1
  modelClaim:
    modelName: opt-125m

Verify

Expose the service

By default, llmaz will create a ClusterIP service named like <service>-lb for load balancing.

kubectl port-forward svc/opt-125m-lb 8080:8080

Get registered models

curl http://localhost:8080/v1/models

Request a query

curl http://localhost:8080/v1/completions \
-H "Content-Type: application/json" \
-d '{
    "model": "opt-125m",
    "prompt": "San Francisco is a",
    "max_tokens": 10,
    "temperature": 0
}'

More than quick-start

Please refer to examples for more tutorials or read develop.md to learn more about the project.

Roadmap

  • Serverless support for cloud-agnostic users
  • Prefill-Decode disaggregated serving
  • KV cache offload support
  • Model training, fine tuning in the long-term

Community

Join us for more discussions:

Contributions

All kinds of contributions are welcomed ! Please following CONTRIBUTING.md.

We also have an official fundraising venue through OpenCollective. We'll use the fund transparently to support the development, maintenance, and adoption of our project.

Star History

Star History Chart

Extension points exported contracts — how you extend this code

OpenModelsGetter (Interface)
OpenModelsGetter has a method to return a OpenModelInterface. A group's client should implement this interface. [4 implementers]
client-go/clientset/versioned/typed/core/v1alpha1/openmodel.go
GenericInformer (Interface)
GenericInformer is type of SharedIndexInformer which will locate and delegate to other sharedInformers based on type [4 …
client-go/informers/externalversions/generic.go
Plugin (Interface)
Plugin is the parent type for all the framework plugins. the same time. [3 implementers]
components/router/pkg/dispatcher/framework/framework.go
UnstructuredConverter (Interface)
UnstructuredConverter is an interface for converting between interface{} and map[string]interface representation. [1 implementers]
pkg/util/convert.go
ModelSourceProvider (Interface)
(no doc) [2 implementers]
pkg/controller_helper/modelsource/modelsource.go
OpenModelLister (Interface)
OpenModelLister helps list OpenModels. All objects returned here must be treated as read-only.
client-go/listers/core/v1alpha1/openmodel.go
CheckServiceAvailableFunc (FuncType)
(no doc)
test/util/validation/validate_service.go
PlaygroundsGetter (Interface)
PlaygroundsGetter has a method to return a PlaygroundInterface. A group's client should implement this interface. [4 implementers]
client-go/clientset/versioned/typed/inference/v1alpha1/playground.go

Core symbols most depended-on inside this repo

Obj
called by 96
test/util/wrapper/model.go
Create
called by 65
client-go/clientset/versioned/typed/core/v1alpha1/openmodel.go
Get
called by 50
components/router/pkg/store/store.go
MakePlayground
called by 39
test/util/wrapper/playground.go
MakeModel
called by 35
test/util/wrapper/model.go
FamilyName
called by 35
test/util/wrapper/model.go
ValidatePlayground
called by 32
test/util/validation/validate_playground.go
ValidatePlaygroundStatusEqualTo
called by 32
test/util/validation/validate_playground.go

Shape

Method 455
Function 224
Struct 126
Interface 42
TypeAlias 11
Class 5
FuncType 4

Languages

Go98%
Python2%

Modules by API surface

pkg/util/convert.go44 symbols
api/inference/v1alpha1/zz_generated.deepcopy.go42 symbols
api/core/v1alpha1/zz_generated.deepcopy.go24 symbols
client-go/informers/externalversions/factory.go23 symbols
client-go/applyconfiguration/inference/v1alpha1/service.go21 symbols
client-go/applyconfiguration/inference/v1alpha1/playground.go21 symbols
client-go/applyconfiguration/core/v1alpha1/openmodel.go21 symbols
test/util/wrapper/playground.go16 symbols
pkg/controller/inference/playground_controller.go16 symbols
client-go/clientset/versioned/typed/inference/v1alpha1/service.go16 symbols
client-go/clientset/versioned/typed/inference/v1alpha1/playground.go16 symbols
client-go/clientset/versioned/typed/core/v1alpha1/openmodel.go16 symbols

For agents

$ claude mcp add llmaz \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact