<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Python on jdcsen</title><link>https://jdcsen.com/tags/python/</link><description>Recent content in Python on jdcsen</description><generator>Hugo</generator><language>en</language><lastBuildDate>Thu, 01 Jan 1970 00:33:46 +0000</lastBuildDate><atom:link href="https://jdcsen.com/tags/python/index.xml" rel="self" type="application/rss+xml"/><item><title>Self-Hosted Multi-Modal Inference on One GPU</title><link>https://jdcsen.com/projects/llama-swap-stack/</link><pubDate>Thu, 01 Jan 1970 00:33:46 +0000</pubDate><guid>https://jdcsen.com/projects/llama-swap-stack/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;One OpenAI- and Anthropic-compatible endpoint fronting 36 model keys on a single RTX 5090 (32 GB): 14 LLM keys (Qwen3 coder, thinking and instruct tiers, a vision model, a captioner), 4 Whisper variants, 11 image generators (Flux, SDXL, Chroma, Qwen-Image), 4 Wan video models and 3 GPU feature-extraction sidecars.&lt;/li&gt;&#10;&lt;li&gt;Built on &lt;a href="https://github.com/mostlygeek/llama-swap" target="_blank"&gt;llama-swap&lt;/a&gt;, a Go router that starts and stops upstream inference processes on demand. Anything that speaks HTTP can be an upstream, which is what lets llama.cpp, whisper.cpp, a &lt;a href="https://jdcsen.com/projects/sdcpp-identity-server/"&gt;patched stable-diffusion.cpp&lt;/a&gt; and three PyTorch services share one card behind one API.&lt;/li&gt;&#10;&lt;li&gt;Co-residency is declared with set-algebra rules and eviction costs, but llama-swap does not measure VRAM, so I did: a sweep script that measures resident and peak footprints per model and per combination, which turned up a 6.7 GB transient VAE-decode spike as the binding constraint.&lt;/li&gt;&#10;&lt;li&gt;Every workhorse LLM has two keys: an exclusive full-context key and a co-resident &amp;ldquo;lite&amp;rdquo; twin, so a 256k-context 30B model and an image generator never fight for the card.&lt;/li&gt;&#10;&lt;li&gt;Heavy upstreams run as sibling containers launched on demand, so the router image rebuilds in seconds instead of recompiling sd-server and three multi-gigabyte venvs.&lt;/li&gt;&#10;&lt;/ul&gt;</description></item><item><title>stable-diffusion.cpp: Identity Conditioning in sd-server</title><link>https://jdcsen.com/projects/sdcpp-identity-server/</link><pubDate>Thu, 01 Jan 1970 00:33:46 +0000</pubDate><guid>https://jdcsen.com/projects/sdcpp-identity-server/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;Fork of &lt;a href="https://github.com/leejet/stable-diffusion.cpp" target="_blank"&gt;stable-diffusion.cpp&lt;/a&gt; adding per-request reference-image identity conditioning (PhotoMaker v2 on SDXL bases, PuLID on Flux) to the &lt;code&gt;sd-server&lt;/code&gt; HTTP surface. Upstream registered the flags but only the CLI ever populated them.&lt;/li&gt;&#10;&lt;li&gt;Eleven commits, about 1,900 lines added over 19 files. Roughly 89% lives in &lt;code&gt;examples/server/&lt;/code&gt;; the core engine changes total 87 lines. &lt;code&gt;sd-cli&lt;/code&gt; and the core library stay Python-free.&lt;/li&gt;&#10;&lt;li&gt;Reference-image encoding runs in-process through an embedded CPython interpreter (pybind11), behind two CMake flags that default to OFF so the vanilla build is unchanged.&lt;/li&gt;&#10;&lt;li&gt;Identity embeddings can be extracted once and re-injected: the round trip reproduces the image-path generation byte for byte at a fixed seed.&lt;/li&gt;&#10;&lt;li&gt;&amp;ldquo;No identity images&amp;rdquo; is proven to mean &amp;ldquo;no effect&amp;rdquo;: generations are md5-identical to the bare base model.&lt;/li&gt;&#10;&lt;li&gt;One upstream-worthy bug fix in core: an off-by-one in &lt;code&gt;clip_preprocess&lt;/code&gt; center-cropping that crashed any CLIP-vision path on odd input dimensions.&lt;/li&gt;&#10;&lt;/ul&gt;</description></item><item><title>Paralinguistic Signals from a Speech LLM</title><link>https://jdcsen.com/projects/paralinguistic-features/</link><pubDate>Thu, 01 Jan 1970 00:33:45 +0000</pubDate><guid>https://jdcsen.com/projects/paralinguistic-features/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;NVIDIA Triton Python backend fronting a vLLM-served speech LLM, taken from prototype to production.&lt;/li&gt;&#10;&lt;li&gt;Derives confidence, sentiment and spoken-language ID from the model&amp;rsquo;s own token-level outputs. No additional models to train or serve.&lt;/li&gt;&#10;&lt;li&gt;Orchestrates per-signal LLM queries over gRPC alongside ONNX Runtime inference for confidence calibration and forced alignment.&lt;/li&gt;&#10;&lt;li&gt;p50 latency of approximately 5 to 10 ms per signal.&lt;/li&gt;&#10;&lt;li&gt;Technical lead for a three-engineer team. A later &lt;a href="https://jdcsen.com/projects/triton-throughput-refactor/"&gt;concurrency refactor&lt;/a&gt; took sustained throughput from roughly 8 to 80 requests per second.&lt;/li&gt;&#10;&lt;/ul&gt;</description></item><item><title>RAG Personalization for Speech Recognition</title><link>https://jdcsen.com/projects/rag-asr-personalization/</link><pubDate>Thu, 01 Jan 1970 00:33:45 +0000</pubDate><guid>https://jdcsen.com/projects/rag-asr-personalization/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;Retrieval-augmented personalization for the same speech LLM behind the &lt;a href="https://jdcsen.com/projects/paralinguistic-features/"&gt;paralinguistic backend&lt;/a&gt;.&lt;/li&gt;&#10;&lt;li&gt;A user&amp;rsquo;s contacts, device names and music library are retrieved from their catalogs with approximate-nearest-neighbor search.&lt;/li&gt;&#10;&lt;li&gt;Retrieved entries are injected into the LLM&amp;rsquo;s prefill context, so the model transcribes the user&amp;rsquo;s own vocabulary instead of guessing at it.&lt;/li&gt;&#10;&lt;li&gt;The original design needed three round trips through the LLM per request. Working with the applied science team, we replaced LLM-generated query embeddings with an index keyed on voice features, eliminating one of them, a roughly 20 ms LLM round trip per request.&lt;/li&gt;&#10;&lt;li&gt;Keying retrieval on voice features also decoupled the lookup from the LLM&amp;rsquo;s context request, so retrieval runs speculatively, in parallel with the model, instead of waiting on it.&lt;/li&gt;&#10;&lt;li&gt;Led the effort end to end, from retrieval design to serving.&lt;/li&gt;&#10;&lt;/ul&gt;</description></item><item><title>Triton Backend Throughput Refactor</title><link>https://jdcsen.com/projects/triton-throughput-refactor/</link><pubDate>Thu, 01 Jan 1970 00:33:45 +0000</pubDate><guid>https://jdcsen.com/projects/triton-throughput-refactor/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;Load testing showed latency growing linearly with concurrency: the server was serializing, capping throughput at about 8 requests per second.&lt;/li&gt;&#10;&lt;li&gt;Three structural fixes: parallelize independent ONNX inference calls, replace a reference-counted five-thread dispatcher with single-threaded cooperative multitasking, and run several independent backend instances.&lt;/li&gt;&#10;&lt;li&gt;Latency curve went from linear to roughly square-root in concurrency; sustained throughput reached 64 to 80 requests per second on the same hardware, an 8 to 10x improvement.&lt;/li&gt;&#10;&lt;li&gt;Single-request latency barely moved (about 90 to 70 ms). This was a contention fix, not a per-request speedup.&lt;/li&gt;&#10;&lt;/ul&gt;</description></item><item><title>One-Command Nova Sonic Dev Environments</title><link>https://jdcsen.com/projects/nova-sonic-dev-provisioning/</link><pubDate>Thu, 01 Jan 1970 00:33:44 +0000</pubDate><guid>https://jdcsen.com/projects/nova-sonic-dev-provisioning/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;Python provisioning system that stands up the complete Nova Sonic inference stack on one developer machine.&lt;/li&gt;&#10;&lt;li&gt;Deploys several Triton model containers plus the C++ node-graph orchestrator, wired together and ready to take speech-to-speech traffic.&lt;/li&gt;&#10;&lt;li&gt;Took a fifteen-person team from sharing a couple of hand-built demo environments to every engineer having their own.&lt;/li&gt;&#10;&lt;li&gt;Same pattern as &lt;a href="https://jdcsen.com/projects/l3dockerize/"&gt;L3Dockerize&lt;/a&gt;: make the right environment the cheap one.&lt;/li&gt;&#10;&lt;/ul&gt;</description></item><item><title>L3Dockerize: Python-based containerization tool</title><link>https://jdcsen.com/projects/l3dockerize/</link><pubDate>Thu, 01 Jan 1970 00:33:40 +0000</pubDate><guid>https://jdcsen.com/projects/l3dockerize/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;Python-based Docker container builder.&lt;/li&gt;&#10;&lt;li&gt;Dynamically resolves and fetches software component dependencies to build Docker images.&lt;/li&gt;&#10;&lt;li&gt;Intended to serve as a low/zero cost tool for developers to convert existing software installs to more easily monitorable, scalable, and extensible docker-based installations.&lt;/li&gt;&#10;&lt;li&gt;Concept evaluated in a system-wide CIT test of an L3Harris hardware product.&lt;/li&gt;&#10;&lt;/ul&gt;</description></item><item><title>BUPDATE: Batch Updating tool</title><link>https://jdcsen.com/projects/bupdate/</link><pubDate>Thu, 01 Jan 1970 00:33:39 +0000</pubDate><guid>https://jdcsen.com/projects/bupdate/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;Python/Bash Scripting Toolkit for cross-project refactoring.&lt;/li&gt;&#10;&lt;li&gt;Uninvasive, agile solution to deal with problem of poorly-isolated dependencies impacting many components.&lt;/li&gt;&#10;&lt;li&gt;Core application written in Python, per-project scripts writable in any language.&lt;/li&gt;&#10;&lt;li&gt;Designed according to Unix ”simple, clear, modular, extensible” philosophy to facilitate integration into existing toolchains and processes.&lt;/li&gt;&#10;&lt;li&gt;Successfully deployed to automatically upgrade the dependencies of approx. 60 components without user intervention.&lt;/li&gt;&#10;&lt;/ul&gt;</description></item><item><title>DRAGLINE: Dynamic RAcinG LINE</title><link>https://jdcsen.com/projects/dragline/</link><pubDate>Thu, 01 Jan 1970 00:33:39 +0000</pubDate><guid>https://jdcsen.com/projects/dragline/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;Augmented Reality Racing Line System running on an NVidia Jetson TX2.&lt;/li&gt;&#10;&lt;li&gt;Microservice-based architecture comprised of Python, C++, Javascript, and MySQL components.&lt;/li&gt;&#10;&lt;li&gt;Winner of 2019 Graduating Class Senior Design Competition.&lt;/li&gt;&#10;&lt;li&gt;Honors Thesis was an attempt at replacing L-BFGS-B Gradient Descent optimizer with a more reliable, machine-learning based approach.&lt;/li&gt;&#10;&lt;/ul&gt;</description></item></channel></rss>