Serving Ornith-1.0-35B-NVFP4 via SGLang on RTX 5090

·5 min readlocal-ai

TL;DR: Ornith-1.0-35B-NVFP4 runs at 150+ tokens/second on a single RTX 5090 via SGLang, using NVFP4 quantization, FP8 KV cache, hierarchical offload, and a conservative decode-first scheduling strategy. Long chain-of-thought reasoning burns through the 256K context window, so chunked prefill at 4096 tokens and 2x GPU host L2 cache are non-negotiable. Full sglang serve flag breakdown follows, then optimization timeline, usage notes, and a complete Prometheus/Grafana monitoring stack for production-grade observability.


What Does This Do?

The sglang serve command I run is:

Terminal window
sglang.launch_server \
--model /opt/gguf/Ornith-1.0-35B-NVFP4 \
--port 8082 \
--mem-fraction-static 0.85 \
--max-running-requests 8 \
--context-length 256000 \
--chunked-prefill-size 4096 \
--dtype half \
--kv-dtype fp8_e4m3 \
--schedule-policy lru \
--gpu-memory-utilization 0.85 \
--host 0.0.0.0 \
--max-parallel-loading-workers 4 \
--tensor-parallel-size 1 \
--speculative-num-stages 3 \
--speculative-draft /opt/gguf/draft_model \
--speculative-num-draft-tokens 32 \
--speculative-eval-policy earliest \
--max-num-seqs 8 \
--enable-prefix-caching \
--max-prefill-tokens 4096 \
--write-flush \
--schedule-conservativeness 1.0 \
--enable-hierarchical-cache \
--hicache-ratio 2 \
--enable-mamba-mem-sync \
--mamba-sst-ratio 1 \
--mamba-mem-slots 8 \
--mamba-mem-shape 1024 \
--mamba-cache-host-ratio 0.5 \
--trust-remote-code \
--tool-call-parser qwen3_coder \
--chat-template ./chat_template_fix/chat_template.jinja

Every flag here maps to a specific optimization. SGLang is a large codebase and the default config doesn’t ship with these values — they’re applied one-by-one because Ornith-1.0-35B-NVFP4 has specific requirements that the generic serve command doesn’t cover. This isn’t a one-shot command: it’s a tuned inference engine.

Server Configuration Breakdown

Model Loading

—model /opt/gguf/Ornith-1.0-35B-NVFP4

Specifies the model path. Ornith uses GGUF format with NVFP4 quantization (4-bit normalized mixed precision). The model is a hybrid Mamba-Transformer architecture.

—trust-remote-code

Required for Ornith because the model repo contains custom Python code for the Mamba-Transformer architecture. SGLang needs this to load the specialized model classes.

Tokenization & Chat Templates

—chat-template ./chat_template_fix/chat_template.jinja

This is a custom chat template from froggeric that fixes Ornith’s tokenization quirks. Ornith has specific special tokens and formatting requirements that the default template doesn’t handle correctly. The fix template ensures proper chat formatting for multi-turn conversations with tool calling.

Ornith uses Qwen3-style tool calling in its outputs. Without this template, tool invocations get garbled — the model emits malformed tool call syntax that SGLang’s parser can’t extract.

—tool-call-parser qwen3_coder

SGLang needs to know this format to extract the structured reasoning for tool calling and other downstream tasks.

—tool-call-parser qwen3_coder

Qwen3 has a specific tool-calling format. The qwen3_coder parser is specialized for this syntax — without it, tool calls in the model output may not be recognized and parsed properly.

Scheduling & Throughput

—mem-fraction-static 0.85

Reserves 85% of GPU memory for model weights, KV cache, and activation buffers. The remaining 15% is for PyTorch runtime, CUDA overhead, and headroom. 0.85 is a common default — high enough to maximize usable memory, low enough to avoid OOM crashes from unexpected allocation spikes.

—max-running-requests 8

Caps concurrent requests at 8. This is a memory ceiling — each request reserves its own KV cache allocation, and 8 ensures you don’t exceed available memory even with full context.

—chunked-prefill-size 4096

During prefill (when a new request first loads its prompt), SGLang can process the entire prompt at once or chunk it. 4096 means SGLang processes at most 4096 tokens of prefill per chunk, breaking large prompts into smaller batches.

I lowered this from 8192 to 4096 because Ornith has an aggressive autoregressive decoder. Large prefill chunks cause the model to over-think — it generates excessive reasoning chains and token-burns through the 256K context window before producing useful output. Smaller chunks keep prefill responsive.

This trades slightly slower prefill latency for better throughput across all concurrent requests and more controlled model behavior.

—schedule-conservativeness 1.0

This parameter controls scheduling aggressiveness (0 = most aggressive, 1 = most conservative). At 1.0, SGLang uses the most conservative strategy:

  • Low value (0): Prefill is prioritized heavily. New requests get GPU memory quickly, but ongoing decode requests may get starved.
  • High value (1): Decode is prioritized heavily. New requests queue longer, but ongoing requests finish faster.

At 1.0, I’m prioritizing decode completion over prefill responsiveness. This is critical for Ornith because:

  1. The model’s long CoT reasoning means decode phases are expensive — letting them run uninterrupted avoids wasted tokens.
  2. When a request is mid-reasoning and gets preempted for a new prefill, the model’s planning state is lost and must restart.
  3. The 256K context window means prefill is rarely the bottleneck — decode is.

This is the opposite of the default 0.5 strategy. It works well here because Ornith’s decode phases are long enough that preemption costs more than prefill queuing.

Network Configuration

—host 0.0.0.0 binds to all network interfaces — the inference server is reachable from any machine that can reach this GPU. Not localhost-only.

—port 8082 is the listening port. Standard HTTP on 8082 for the OpenAI-compatible API.

Optimization Timeline

Inference Optimization Timeline

Resolving Host Layout Mismatches

Encountered initialization faults where the hosting structure expected native page alignment strategies. Aligned the backend by implementing explicit page_first_direct memory layout configurations.

Mitigating Volatile VRAM Demands

Encountered runtime memory faults when large request groups competed for cache frames. Reduced token prefill thresholds to 4096 chunks and adjusted static memory limits.

Hardcoding Hybrid SSM Cache Sizes

Fixed calculation bottlenecks that dropped available user slots to zero. Enforced a strict 1-to-1 cache size ratio per active request thread.

Activating Hierarchical Swapping Engine

Enabled zero-copy asynchronous page transfers over PCIe. Offloaded structural tokens to host RAM, saving massive GPU memory blocks during long context cycles.

Deploying Speculative MTP Engines

Integrated native multi-token lookahead parsing arrays. Achieved stable, concurrent generation velocities peaking over 150 tokens per second inside the live decoding loop.

Usage Experience

Throughput

Ornith-1.0-35B-NVFP4 delivers 150+ tokens/second on a single RTX 5090 with this configuration. For comparison, a 7B model at full precision typically tops out around 60-80 t/s. The NVFP4 quantization and FP8 KV cache are the main enablers: less memory pressure means more compute budget for decode.

CoT and Planning

Ornith has a strong bias toward implementation. When given a planning task, it tends to jump straight to writing code rather than thinking through the approach. This is common in Mixture-of-Experts (MoE) models — different experts activate for different tasks, and the “coding expert” is heavily weighted.

This makes chain-of-thought (CoT) prompting critical. Without explicit instruction to think before acting, the model will implement a flawed plan. With CoT: “First, list the steps. Then, write each step. Then, review.” — it behaves much more reliably.

Context Budget

The 256K token context window is generous but Ornith burns through it quickly. During extended conversations, the model’s CoT reasoning can consume 100K+ tokens before generating a useful answer. This means:

  • Shorter practical context than the nominal 256K suggests — useful context might top out at ~50-80K tokens after accounting for reasoning overhead.
  • Hierarchical cache is essential — without it, the model would OOM long before reaching the full context window.
  • Chunked prefill at 4096 helps prevent the model from over-thinking during prompt loading.

Tool Calling

The qwen3_coder tool-call parser works well with Ornith. The model’s tool-calling syntax aligns with Qwen3’s format, and SGLang’s parser correctly extracts tool invocations without false positives.

Observability: Monitoring via Prometheus

Instantaneous metrics or terminal snapshots fail to reveal the true performance behavior of a hybrid inference server. Real-world analysis requires querying the Prometheus /metrics collector via continuous time-series line charts.

1. Reconciling Live Output Gauges vs 1-Minute Averages

Terminal logs frequently display high decoding velocities (e.g., gen throughput (token/s): 159.20), while standard Grafana dashboard counters might report significantly lower figures like 44 pps. This discrepancy is caused by the mathematical smoothing window of the PromQL rate() function.

# The Standard Smoothed Counter (Reveals macro trends, but hides performance spikes)
sum(rate(sglang:generation_tokens_total[1m]))

The standard counter aggregates token output over a rolling 60-second window. If a request finishes in 15 seconds, the remaining 45 seconds of inactivity drag down the average. To monitor actual peak output speeds, graph the live engine state directly:

# The True Live Decode Vector Line (Panel ID: 1)
sglang:gen_throughput

2. Monitoring Prefill Input Bursts

The prefill phase processes massive prompts simultaneously in compute-bound matrix blocks, so measuring it over a standard 1-minute rate completely flattens the data.

# The High-Resolution Input Velocity Line (Panel ID: 3)
sum(rate(sglang:prompt_tokens_total[5s]))

By narrowing the evaluation window to a tight [5s] range selector, the dashboard isolates the explosive processing pressure of prompt ingestion.

3. Profiling Radix Caching Efficiency

SGLang breaks down prefix cache hits into distinct channels based on where the tokens were recovered.

# Radix Cache Source Distribution Line (Panel ID: 8)
sum(rate(sglang:cached_tokens_total[1m])) by (cache_source)

This exposes two source vectors:

  • cache_source=“device”: Tokens instantly retrieved from high-speed GPU VRAM.
  • cache_source=“host”: Tokens fetched from system RAM over the PCIe bus.

4. Diagnosing PCIe Memory Bus Bottlenecks

When request concurrency spikes, the hierarchical caching engine moves inactive tokens out of the GPU to prevent OOM. Monitor this with eviction counters:

# GPU to Host RAM Eviction Line (Panel ID: 9)
sum(rate(sglang:evicted_tokens_total[1m]))
# Host RAM to GPU Fetch Back Line (Panel ID: 9)
sum(rate(sglang:load_back_tokens_total[1m]))

Production Warning Signs: If eviction and load-back trendlines spike simultaneously while sglang

craters, the system is thrashing — the GPU is constantly bouncing active Mamba states and KV frames across the PCIe bus. Fix by decreasing —max-running-requests or expanding host memory buffer thresholds.

5. Tracking Latency Distributions Across Engine Stages

# Detailed Request Stage Performance Profiling (Panel ID: 10)
histogram_quantile(0.95, sum(rate(sglang:per_stage_req_latency_seconds_bucket[5m])) by (le, stage))

This isolates and graphs individual lines for each processing stage:

  • stage=“request_process”: Delays in input parsing and tokenization.
  • stage=“prefill_forward”: Latency of processing whole prompts.
  • stage=“chunked_prefill”: Execution time of segmented prompt chunks.

Grafana Dashboard

Here’s the dashboard I use to monitor this setup:

{
"annotations": { "list": [] },
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 1,
"id": null,
"links": [],
"liveNow": false,
"panels": [
{
"title": "Real-Time Generation Speed Trend",
"type": "timeseries",
"gridPos": { "h": 7, "w": 12, "x": 0, "y": 0 },
"id": 1,
"targets": [
{ "expr": "sglang:gen_throughput", "legendFormat": "Live Generation Throughput", "refId": "A" }
],
"fieldConfig": {
"defaults": {
"unit": "pps",
"noValue": "0",
"custom": { "drawStyle": "line", "lineInterpolation": "smooth", "lineWidth": 2, "fillOpacity": 10 }
}
}
},
{
"title": "Inference Concurrency & Queue History",
"type": "timeseries",
"gridPos": { "h": 7, "w": 12, "x": 12, "y": 0 },
"id": 2,
"targets": [
{ "expr": "sglang:num_running_reqs", "legendFormat": "Active Running Requests", "refId": "A" },
{ "expr": "sglang:num_queue_reqs", "legendFormat": "Queued Waiting Requests", "refId": "B" }
],
"fieldConfig": {
"defaults": {
"unit": "none",
"noValue": "0",
"custom": { "drawStyle": "stepAfter", "lineWidth": 2 }
}
}
},
{
"title": "Token Processing Volume (Input vs Output Trends)",
"type": "timeseries",
"gridPos": { "h": 7, "w": 12, "x": 0, "y": 7 },
"id": 3,
"targets": [
{ "expr": "sum(rate(sglang:prompt_tokens_total[5s]))", "legendFormat": "Prefill Token Throughput (5s Window)", "refId": "A" },
{ "expr": "sum(rate(sglang:generation_tokens_total[1m]))", "legendFormat": "Decode Generation Throughput (1m Avg)", "refId": "B" }
],
"fieldConfig": {
"defaults": {
"unit": "pps",
"custom": { "drawStyle": "line", "lineInterpolation": "smooth" }
}
}
},
{
"title": "GPU KV Cache Memory Architecture Splits",
"type": "timeseries",
"gridPos": { "h": 7, "w": 12, "x": 12, "y": 7 },
"id": 4,
"targets": [
{ "expr": "sglang:kv_used_tokens", "legendFormat": "Actively Locked Allocation", "refId": "A" },
{ "expr": "sglang:kv_evictable_tokens", "legendFormat": "Evictable Radix Cache Memory", "refId": "B" },
{ "expr": "sglang:kv_available_tokens", "legendFormat": "Completely Free Spaces", "refId": "C" }
],
"fieldConfig": {
"defaults": {
"unit": "none",
"custom": { "drawStyle": "line", "stacking": { "group": "KV", "mode": "normal" } }
}
}
},
{
"title": "Hierarchical Offload Capacity (Host Memory RAM Tracking)",
"type": "timeseries",
"gridPos": { "h": 6, "w": 8, "x": 0, "y": 14 },
"id": 5,
"targets": [
{ "expr": "sglang:hicache_host_used_tokens", "legendFormat": "Tokens Currently Offloaded to Host RAM", "refId": "A" },
{ "expr": "sglang:hicache_host_total_tokens", "legendFormat": "Total Configured Host Memory Space", "refId": "B" }
],
"fieldConfig": {
"defaults": { "unit": "none", "custom": { "drawStyle": "line" } }
}
},
{
"title": "Mamba and Framework State Memory Usage Rates",
"type": "timeseries",
"gridPos": { "h": 6, "w": 8, "x": 8, "y": 14 },
"id": 6,
"targets": [
{ "expr": "sglang:mamba_usage", "legendFormat": "Mamba Layer Token State Usage Rate", "refId": "A" },
{ "expr": "sglang:token_usage", "legendFormat": "Global Frame Token Usage Rate", "refId": "B" }
],
"fieldConfig": {
"defaults": { "unit": "percentunit", "min": 0, "max": 1, "custom": { "drawStyle": "line" } }
}
},
{
"title": "Radix Cache Memory Allocation Split Tracking",
"type": "timeseries",
"gridPos": { "h": 6, "w": 8, "x": 16, "y": 14 },
"id": 7,
"targets": [
{ "expr": "sglang:mamba_used_tokens", "legendFormat": "Active Mamba States In-Use", "refId": "A" },
{ "expr": "sglang:mamba_evictable_tokens", "legendFormat": "Radix-Cached Evictable Mamba States", "refId": "B" }
],
"fieldConfig": {
"defaults": { "unit": "none", "custom": { "drawStyle": "line" } }
}
},
{
"title": "Radix Prefix Cache Hits Tracking History",
"type": "timeseries",
"gridPos": { "h": 6, "w": 12, "x": 0, "y": 20 },
"id": 8,
"targets": [
{ "expr": "sum(rate(sglang:cached_tokens_total[1m])) by (cache_source)", "legendFormat": "Prefix Hits via {{cache_source}}", "refId": "A" }
],
"fieldConfig": {
"defaults": { "unit": "pps", "custom": { "drawStyle": "line" } }
}
},
{
"title": "PCIe Memory Bus Swapping Metrics",
"type": "timeseries",
"gridPos": { "h": 6, "w": 12, "x": 12, "y": 20 },
"id": 9,
"targets": [
{ "expr": "sum(rate(sglang:evicted_tokens_total[1m]))", "legendFormat": "GPU -> Host RAM Eviction Speed", "refId": "A" },
{ "expr": "sum(rate(sglang:load_back_tokens_total[1m]))", "legendFormat": "Host RAM -> GPU Fetch Back Speed", "refId": "B" }
],
"fieldConfig": {
"defaults": { "unit": "pps", "custom": { "drawStyle": "line" } }
}
},
{
"title": "Time to First Token (TTFT Latency Distribution Trends)",
"type": "timeseries",
"gridPos": { "h": 6, "w": 12, "x": 0, "y": 26 },
"id": 10,
"targets": [
{ "expr": "histogram_quantile(0.99, sum(rate(sglang:time_to_first_token_seconds_bucket[5m])) by (le))", "legendFormat": "P99 TTFT (Tail Latency)", "refId": "A" },
{ "expr": "histogram_quantile(0.50, sum(rate(sglang:time_to_first_token_seconds_bucket[5m])) by (le))", "legendFormat": "P50 TTFT (Median Latency)", "refId": "B" }
],
"fieldConfig": {
"defaults": { "unit": "s", "custom": { "drawStyle": "line", "lineInterpolation": "smooth" } }
}
},
{
"title": "Inter-Token Latency (ITL Generation Latency Engines)",
"type": "timeseries",
"gridPos": { "h": 6, "w": 12, "x": 12, "y": 26 },
"id": 11,
"targets": [
{ "expr": "histogram_quantile(0.99, sum(rate(sglang:inter_token_latency_seconds_bucket[5m])) by (le))", "legendFormat": "P99 ITL (Worst-case)", "refId": "A" },
{ "expr": "histogram_quantile(0.50, sum(rate(sglang:inter_token_latency_seconds_bucket[5m])) by (le))", "legendFormat": "P50 ITL (Median Speed)", "refId": "B" }
],
"fieldConfig": {
"defaults": { "unit": "s", "custom": { "drawStyle": "line", "lineInterpolation": "smooth" } }
}
}
],
"refresh": "5s",
"schemaVersion": 38,
"style": "dark",
"tags": ["sglang-historical-lines"],
"time": { "from": "now-30m", "to": "now" },
"title": "SGLang Historical Production Framework Fleet Charts",
"timezone": "browser"
}

Why This Stack?

This deployment isn’t generic — it’s optimized for a specific model, a specific use case, and a specific hardware constraint:

  1. NVFP4 + FP8 KV cache = maximum model + KV cache fit on a single GPU. Without these, the 35B model would need 2x GPU memory.
  2. Hierarchical cache (ratio 2x GPU) = long-context requests don’t blow up GPU memory. Dynamic allocation scales with GPU size — ~48GB host L2 on a 24GB card.
  3. Mamba-aware caching = the hybrid architecture’s state vectors get proper treatment in the radix tree, with 8 state slots matching concurrent requests.
  4. Conservative scheduling + small prefill chunks = decode-first strategy prevents wasting tokens on preempted reasoning chains. Specific to Ornith’s heavy CoT behavior.
  5. Write-through cache = correctness over throughput. In production, this matters more than marginal speed gains.

The result: a single-GPU inference server that handles long-context multi-turn conversations from 8 clients simultaneously, with a hybrid Mamba+Transformer model quantized to 4 bits, without OOM errors.


References

  1. SGLang Documentation — Hierarchical Cache (HiCache) — https://docs.sglang.ai
  2. HiCache: Fast Hierarchical KV Caching — LMSYS Org (2026) — https://www.lmsys.org
  3. HiCache for Hybrid and Sparse LLMs (Issue #12826) — sgl-project/sglang — https://github.com/sgl-project/sglang/issues/12826
  4. SGLang Production Metrics Documentation — sgl-project — https://sgl-project-sglang-93.mintlify.app/observability/metrics
  5. Issue #10672: Metric Typology Redesign — sgl-project — https://github.com/sgl-project/sglang/issues/10672
  6. metrics_collector.py — sgl-project — https://github.com/sgl-project/sglang/blob/main/python/sglang/srt/observability/metrics_collector.py
  7. Server Metrics Reference — AIPerf — https://github.com/ai-dynamo/aiperf/blob/main/docs/server-metrics/server-metrics-reference.md

This article was co-written by Pi Agent (Ornith-1.0-35B-NVFP4 | PC Eyay) and Gemini (Gemini 2.5 Flash | Google), edited by me and Pi Agent.