Ultra-Large Open-Source Model Evaluation, Cost, and Deployment Guide

    This guide covers how to verify leaderboard claims with your own business test set, evaluate front-end code that models generate, calculate API token costs, and deploy, autoscale, and monitor large model inference on Kubernetes. It ends with a pre-launch checklist.

    1. Capability Verification and Model Selection

    Benchmark scores only mean something when you know the evaluation conditions. When you see a claim like “ranks near the top,” first confirm four things: who ran the evaluation, the leaderboard version and release date, which models were compared, and how the scores were calculated.

    Beyond public leaderboards, test with your own business data. Collect 100 to 300 real tasks and group them into four categories: common requests, edge cases (vague requirements or missing information), long inputs (close to the context limit), and format constraints (required JSON output or a fixed template). Each category should be representative. Do not select only the tasks that are easy to pass.

    Fix the inference parameters during testing, including temperature, top_p, and maximum output length. Run each task at least three times, and record the mean pass rate and its variation. Also record P50 and P90 latency. Archive each failed case with a label for its cause so you can compare results during later retests.

    For selection, use the checklist below. The thresholds in the table are examples only. Set them according to your business requirements.

    Check item What to confirm Example pass threshold Retest cycle
    Model version Exact version number and release date Matches the procurement document Every upgrade
    License Commercial terms and usage restrictions Legal team confirms commercial use is allowed Quarterly
    Context length Stated limit and actual performance on long-input samples Pass rate on long-input samples is at least 85% Every upgrade
    Quantization Precision and quantization format Pass rate drops by no more than 3 percentage points compared with the unquantized version Every deployment
    Evaluation set contamination Whether the training data may include evaluation questions Gap between private sample scores and public leaderboard scores is within an acceptable range Every six months
    Business sample pass rate Mean and variation across three runs Mean meets business requirements, and variation is below 5 percentage points Monthly
    Cost Token cost per task Below the budget ceiling Monthly
    Latency P50 and P90 P90 is below product requirements Weekly

    2. Front-End Code Generation Evaluation

    Evaluating front-end code generation means checking whether the model writes a page that runs and meets the requirements. Confirming that the code runs does not show that its quality is good. Review each item below:

    • Rendering: The page opens normally, and the console shows no uncaught errors.
    • Interaction: Clicks, form submissions, state changes, and other behavior match the requirements. Verify each requirement one by one.
    • Accessibility: The page uses semantic HTML, supports keyboard operation, and meets text-to-background contrast standards.
    • Responsive layout: Check for layout breakage in at least desktop and mobile viewports.
    • Dependency installation: A lock file exists, and npm ci succeeds in a clean environment.
    • Build: The build command returns exit code 0.
    • Verification method: Keep screenshots of key pages and compare them with baseline images, or cover the core logic with unit tests.

    You can score the output by dimension. Example:

    Dimension Scoring criteria Maximum score
    Runnable Rendering, interaction, and build all pass 40
    Visual consistency Deviation from the design spec or screenshot baseline 20
    Maintainability Clear component structure, with no hardcoded repeated styles 20
    Security boundary No hardcoded secrets, and no unsafe HTML injection 20

    Common mistakes include: running the code without verifying interactions, ignoring dependency versions, skipping responsive and accessibility checks, not recording the prompt and model version used for generation, and not checking whether the generated code contains secrets.

    3. API Pricing and Token Costs

    Calculate the cost of a single request with this formula:

    Cost per request = (input tokens × input price + output tokens × output price + cached tokens × cache price) ÷ pricing unit × exchange rate × (1 + tax rate)

    Keep these points in mind:

    • Cache hits and misses are billed separately. Cache prices are usually lower than standard input prices, but the exact ratio depends on the vendor’s documentation.
    • Output token prices are usually higher than input prices, so long-output tasks have a greater impact on cost.
    • Batch APIs often offer discounts but have higher latency, so they suit offline tasks.
    • Include tokens from failed retries, tool calls, and system prompts.
    • Set the exchange rate and tax rate based on the purchasing entity’s location and payment method.

    Here is a demonstration example. Assume an input price of 2 CNY per million tokens and an output price of 8 CNY per million tokens. A single request uses 2,000 input tokens and produces 500 output tokens:

    Cost per request = 2000 × 2 ÷ 1000000 + 500 × 8 ÷ 1000000 = 0.004 + 0.004 = 0.008 CNY

    At 100,000 requests per day, the daily cost is 800 CNY. With a 10% retry rate, the daily cost rises to about 880 CNY. Over 30 days, that totals about 26,400 CNY. These figures only illustrate the calculation method. Do not use them as a basis for purchasing decisions. Use the vendor’s quote and your actual bills for real costs.

    4. Kubernetes Deployment, Autoscaling, and Monitoring

    Before deployment, confirm the following: the cluster version supports the API requirements of the GPU device plugin and HPA; the inference service runs in a dedicated namespace with a least-privilege ServiceAccount; images come from a trusted registry and are pinned by digest; and the location and license of the model weights have been verified.

    The Deployment configuration below shows the key settings. GPU requests and limits must be equal, and the probe paths must match the health check endpoints of your inference framework.

    1. apiVersion: apps/v1
    2. kind: Deployment
    3. metadata:
    4. name: llm-infer
    5. namespace: llm-serving
    6. spec:
    7. replicas: 2
    8. selector:
    9. matchLabels:
    10. app: llm-infer
    11. strategy:
    12. type: RollingUpdate
    13. rollingUpdate:
    14. maxSurge: 1
    15. maxUnavailable: 0
    16. template:
    17. metadata:
    18. labels:
    19. app: llm-infer
    20. spec:
    21. serviceAccountName: llm-infer-sa
    22. nodeSelector:
    23. accelerator: gpu
    24. securityContext:
    25. runAsNonRoot: true
    26. containers:
    27. - name: server
    28. image: registry.example.com/llm/infer@sha256:REPLACE_DIGEST
    29. ports:
    30. - containerPort: 8000
    31. resources:
    32. requests:
    33. cpu: "4"
    34. memory: 32Gi
    35. nvidia.com/gpu: 1
    36. limits:
    37. cpu: "8"
    38. memory: 32Gi
    39. nvidia.com/gpu: 1
    40. readinessProbe:
    41. httpGet:
    42. path: /health/ready
    43. port: 8000
    44. initialDelaySeconds: 60
    45. periodSeconds: 10
    46. livenessProbe:
    47. httpGet:
    48. path: /health/live
    49. port: 8000
    50. initialDelaySeconds: 180
    51. periodSeconds: 20
    52. env:
    53. - name: API_KEY
    54. valueFrom:
    55. secretKeyRef:
    56. name: llm-infer-secret
    57. key: api-key

    Use a Service to expose the inference API within the cluster:

    1. apiVersion: v1
    2. kind: Service
    3. metadata:
    4. name: llm-infer
    5. namespace: llm-serving
    6. spec:
    7. selector:
    8. app: llm-infer
    9. ports:
    10. - port: 80
    11. targetPort: 8000

    GPU utilization is not a default HPA metric, so scaling based on queue length is recommended. First, expose inference_queue_length as a custom metric through Prometheus Adapter.

    ```yaml
    apiVersion: autoscaling/v2
    kind: HorizontalPodAutoscaler
    metadata:
    name: llm-infer-hpa
    namespace: llm-serving
    spec:
    scaleTargetRef: