# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

apiVersion: nvidia.com/v1alpha1
kind: DynamoGraphDeployment
metadata:
  name: sglang-agg-router
spec:
  services:
    Frontend:
      dynamoNamespace: sglang-agg-router
      componentType: frontend
      replicas: 1
      resources:
        requests:
          cpu: "10"
          memory: "10Gi"
        limits:
          cpu: "32"
          memory: "40Gi"
      extraPodSpec:
        mainContainer:
          image: my-registry/sglang-runtime:my-tag
          workingDir: /workspace/components/backends/sglang
          command: ["sh", "-c"]
          args:
            - "python3 -m dynamo.sglang.utils.clear_namespace --namespace sglang-agg-router && python3 -m dynamo.frontend --http-port=8000  --router-mode kv"
    SGLangDecodeWorker:
      envFromSecret: hf-token-secret
      dynamoNamespace: sglang-agg-router
      componentType: worker
      replicas: 1
      resources:
        requests:
          cpu: "10"
          memory: "20Gi"
          gpu: "1"
        limits:
          cpu: "32"
          memory: "80Gi"
          gpu: "1"
      extraPodSpec:
        mainContainer:
          image: my-registry/sglang-runtime:my-tag
          workingDir: /workspace/components/backends/sglang
          command:
            - /bin/sh
            - -c
          args:
            - >-
              python3 -m dynamo.sglang.worker
              --model-path deepseek-ai/DeepSeek-R1-Distill-Llama-8B
              --served-model-name deepseek-ai/DeepSeek-R1-Distill-Llama-8B
              --page-size 16
              --tp 1
              --trust-remote-code
              --skip-tokenizer-init
