Repository navigation
Description
Update 2026-11-26 (infra move): the serving work is now in dan-petty/homelab.
- The TEI Deployment, the gateway order and the live proofs are a follow-up issue there.
- This issue keeps the AI spend change in
k8s/devops/dashboards/ai-spend.json, so TEI embedding tokens count as local. - A new manifest file also needs a line in
MANIFESTS_BY_STACKhere (devops k8s deploy-stack). - Read each
k8s/llmpath below as a homelab path.
Follow-up: dan-petty/homelab#286.
Problem or Motivation
The two Ollama embed pods (ollama-24gib-embed-gpu0 and -gpu1, Pascal P6000) queue. Measured at the gateway over 7 days:
- each batch request has p50 8.4 s and p95 28.6 s;
- 745 requests took over 30 s, and 529 calls ended with status 499 in 30 days;
- each pod is busy about 42% of the day.
Ollama makes one runner call for each input, with no token batching, and interactive query embeddings wait behind bulk batches.
In the cluster trial of 2026-11-11 (#4961), TEI 1.9.4 on one RTX 3090 embedded with Qwen3-Embedding-0.6B at up to 40,971 tokens/s (151 texts/s), against 6,626 tokens/s (45 texts/s) for both Ollama pods through the gateway. Its single-query latency was p50 4.0 ms and p95 4.5 ms, with a VRAM peak of 2,258 MiB. Its vectors match the Ollama route (cosine min 0.9984), so no re-embed is necessary. This is a speed change, not a quality change.
TEI does not run on the Pascal GPUs (cc 6.1). A move needs a share of an Ampere or newer GPU. With the rerank pod of #4970 on the same RTX 3090, both TEI pods leave about 1.1 GiB of the 7-day headroom.
Proposed Solution & Architectural Design
Do this only if the trial #4968 shows that the shared GPU keeps the chat tier safe.
- Add a TEI 1.9.4 Deployment with
Qwen/Qwen3-Embedding-0.6Bat revision 97b0c614 on an Ampere or newer GPU (the Blackwell node when it is Ready again), with the pattern of feat(k8s): serve a cross-encoder rerank route on TEI #4970. - In LiteLLM, keep
model_name: qwen3-embedding:0.6b. Add the TEI deployment (openai/provider,api_base<tei-embed-service>/v1) as order 1, and keep the two Ollama deployments as order 2 for fallback. - The client keeps its query instruction prefix. Set no TEI default prompt.
- The model name does not change, so the retriever model check, the Qdrant points and the cache keys stay valid.
- Decide the future of the Pascal GPUs in the same change: PyTorch CUDA 12.6 wheels, the last with sm_61 and sm_70, stop at PyTorch 2.15, and only Ollama and llama.cpp still run on them.
Target Subsystem
Kubernetes manifests in k8s/llm and the LiteLLM gateway config of dan-petty/homelab (follow-up issue), and the AI spend dashboard.
Existing Tool Considered
Hugging Face Text Embeddings Inference 1.9.4 (Apache-2.0) with Qwen/Qwen3-Embedding-0.6B (Apache-2.0), LiteLLM order fallback, Argo CD and DCGM. No code is added to the CLI. Estimated cost: about 0.20M tokens and 3 hours.
Acceptance criteria
- Gateway embedding p95 <= 5 s over 7 days (today 28.6 s), and 0 status 499 in 7 days.
- Single-query embedding p95 <= 250 ms during a full re-index.
- When the TEI pod stops, embedding calls go to Ollama with no client error.
- Cosine of TEI and Ollama vectors >= 0.998 on 100 texts. Eval nDCG@10 changes by less than the bootstrap interval. No re-index.
- The chat tier on the shared GPU has 0 OOM restarts in 7 days.
Dependencies
#4968 (the GPU trial) and #4970 (the TEI deployment pattern).
Source: #4961
Alternatives check of 2026-11-26: not-applicable.
Class: perf, no model call.
Tool: none found.
Proposed design
Problem statement
The two Pascal Ollama embed pods queue: gateway embedding p95 is 28.6 s over 7 days and 529 calls ended with status 499 in 30 days. The TEI trial of 2026-11-11 matched the Ollama vectors at cosine 0.9984 and served much faster. The TEI Deployment, the gateway order and the live proofs moved to dan-petty/homelab#286 in the infra repo dan-petty/homelab. This issue keeps the AI spend change: the dashboard must count the TEI embedding tokens as local savings, so the local savings do not fall when the embedding traffic moves off Ollama. dan-petty/homelab#286 must use a LiteLLM provider label that no hosted provider uses.
Acceptance criteria
Requirement: TEI embedding tokens count as local savings
The AI spend dashboard SHALL include the provider label of the TEI embedding deployment in the in-cluster filter of every local-savings query, and SHALL name that provider in the description of each local-savings panel.
Scenario: The k8s check accepts the AI spend dashboard
- WHEN a person runs
uv run devops ci --check --only k8safter the change - THEN the check exits 0 and reports no error for
k8s/devops/dashboards/ai-spend.json.
Requirement: The TEI prompt tokens get the embedding price
The local-savings query MUST map the TEI provider to operation embeddings, so its prompt tokens join the reference price at the embedding operation and not the chat operation.
Scenario: The k8s check accepts the local-savings query
- WHEN a person runs
uv run devops ci --check --only k8safter the change - THEN the check exits 0 and reports no error for the rendered dashboard.
Requirement: Pending a person after the merge
The change MUST show the TEI embedding tokens as local savings in the AI spend dashboard after dan-petty/homelab#286 serves the TEI deployment.
Scenario: A person reads the local savings after the TEI deployment is live
- WHEN a person queries
sum(increase(litellm_input_tokens_metric_total{api_provider="hosted_vllm"}[1h]))in Prometheus after the TEI deployment serves traffic - THEN the query returns a value above zero, and the
Local Cloud Savings in Rangepanel counts that value.
Existing Tool Considered
The alternatives check of 2026-11-26 gives not-applicable for this perf item and found no tool; the block in the issue body holds that result. Grafana, with Prometheus and the LiteLLM counters, covers the need: the change edits the existing dashboard k8s/devops/dashboards/ai-spend.json and builds no code. The TEI Deployment and its provider label land in dan-petty/homelab#286, so the cost of that work is not in this issue.
Key questions
- Which provider label does the dashboard use for the TEI embedding tokens?: The TEI deployment uses LiteLLM's self-hosted OpenAI-compatible provider
hosted_vllm/, so itsapi_providerlabel ishosted_vllm. The dashboard addshosted_vllmto the in-cluster filter of each local-savings query and maps it to operationembeddings. No hosted provider uses that label, so a hosted call never counts as local savings.dan-petty/homelab#286must set the same provider. (best practice) [sources: k8s/devops/dashboards/ai-spend.json]- Chosen:
hosted_vllm/in LiteLLM andhosted_vllmin the dashboard filter. The label names a self-hosted server only, so the filter cannot count a hosted call. - Rejected:
openai/as the body proposes. The labelopenaiis also a hosted provider, so a hosted OpenAI embedding call would count as local savings, against fix(ai): do not classify gateway endpoint as local serving backend #5867 and fix(monitoring): price local savings at the reference model #5914. - Rejected:
huggingface/with the TEIapi_base. The labelhuggingfaceis also a hosted provider.
- Chosen:
- Does the reference embedding price change for the TEI tokens?: No. The dashboard prices an embedding prompt token at the hosted price of
qwen/qwen3-embedding-8b. The TEI deployment serves the same 0.6B model as the Ollama route, so the reference price stays. [sources: k8s/devops/dashboards/ai-spend.json, src/devops_cli/ai/spend/pricing.py] - Do the embedding model name and the vector dimension change?: No. The gateway keeps
model_name: qwen3-embedding:0.6b, and the TEI deployment servesQwen/Qwen3-Embedding-0.6Bunder that name. The retriever model check, the Qdrant points and the cache keys stay valid. [sources: k8s/devops/dashboards/ai-spend.json, tests/ai/rag/test_embedding_model_compatibility.py] - Where do the TEI Deployment, the gateway order and the live proofs go?: They go to
dan-petty/homelab#286in the infra repo dan-petty/homelab. This issue keeps the AI spend dashboard change only. [sources: CONTEXT.md] - What happens to the
MANIFESTS_BY_STACKline and the Pascal GPU decision?: The proposal defers theMANIFESTS_BY_STACKline to a new issue, because the manifest file lands indan-petty/homelab#286. The Pascal GPU decision is a hardware decision and moves with the serving work todan-petty/homelab#286. (best practice) [sources: src/devops_cli/commands/k8s/stack_lifecycle.py:293, CONTEXT.md]- Chosen: Defer the
MANIFESTS_BY_STACKline to a new issue.deploy-stackwould name a manifest file that the environment tree does not hold untildan-petty/homelab#286merges. - Rejected: Add the line in this change. The path does not exist in the environment tree yet.
- Rejected: Block this issue on
dan-petty/homelab#286. The dashboard change is workable now, and a post-merge live proof covers the rest.
- Chosen: Defer the
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 12, 2026
Both target embedding latency on the P6000 GPU tier, but #3501 sets GPU thresholds and tier assignments while the candidate replaces the inference engine with TEI.devops-cli-service commentedon Nov 15, 2026
Alternatives check: not-applicable
Class: perf. The check makes no search and no model call for an item of this class.
Tool: none found
Checked on 2026-11-15. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 16, 2026
Refine cannot set this item to Ready at 181f85e while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
devops-cli-service commentedon Nov 26, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.
devops-cli-service commentedon Nov 27, 2026
Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.
perf(k8s): count hosted_vllm TEI embeddings in local savings (#4975)
perf(k8s): count hosted_vllm TEI embeddings in local savings (#4975)
perf(k8s): count hosted_vllm TEI embeddings in local savings (#4975)
chore(main): release 0.248.0 (#7763)
devops-cli-service commentedon Nov 29, 2026
Released in v0.248.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.248.0
devops-cli-service commentedon Nov 29, 2026
Live since 2026-11-29 16:50 UTC