How to Move Independent Work Through an asyncio Pipeline
A practical asyncio workflow for moving independent work through typed events, queues, concurrent tasks, and awaited API calls. Learn where validation and fallback belong.
Loading…
Topic
249 posts about Python. Every summary links to the original.
See the idea
A practical asyncio workflow for moving independent work through typed events, queues, concurrent tasks, and awaited API calls. Learn where validation and fallback belong.
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
Newest first
During an initiative to upgrade Python services from version 3.8 to 3.10, Lyft engineers encountered severe latency spikes and timeouts in one service within their test environment. Profiling DynamoDB queries revealed that gevent thread joins were taking up to 30 seconds while pod memory consumption climbed steadily. To isolate the issue, engineers used an internal tracemalloc-based profiler triggered via SIGUSR2 signals, temporarily disabling Gunicorn preload to prevent workers from terminating prematurely on signal receipt. Memory traces pointed to botocore and an incompatibility between weakref.finalize and gevent monkey patching in urllib3 version 1.26.16, which prevented connections from returning to the pool. Downgrading urllib3 to version 1.26.15 immediately resolved both the timeouts and the memory leak before a permanent fix arrived in gevent and urllib3 updates.
Mathematical reasoning in large language models often suffers from lengthy chain-of-thought traces and frequent arithmetic mistakes. To address these issues, DeepMath pairs a Qwen3-4B Thinking base model with a sandboxed Python execution environment built using the smolagents library and vLLM backend. The system offloads deterministic calculations by emitting concise Python snippets, executing them safely with restricted module imports and no network access, and folding returned values back into the context. Training utilizes Group Relative Policy Optimization on the Tool-Integrated Reasoning subset of OpenMathReasoning with temperature scheduling and length constraints. Across benchmarks including MATH500, AIME, HMMT, and HLE, DeepMath reduces output token lengths by up to 66% while increasing overall problem-solving accuracy.
Transformers v5.0.0rc-0 introduces major architectural updates focused on simplicity, training, inference, and ecosystem interoperability across modern AI workflows. The release adopts a modular modeling approach and centralizes attention implementations into a unified AttentionInterface abstraction to reduce contribution and code review overhead. Support for Flax and TensorFlow is officially sunset in favor of focusing on PyTorch as the primary backend, while tokenization is standardized around the tokenizers library. For execution workloads, v5 adds native continuous batching, paged attention mechanisms, and a dedicated transformers serve OpenAI-compatible serving system. Finally, weight loading is refactored to make low-precision quantization a first-class citizen alongside broad interoperability with formats such as GGUF, MLX, and TorchAO.
For the 2025 NYC marathon weekend, Shopify and Endorphins Running built a gamified treadmill that awarded in-store credit for maintaining a self-selected pace. Participants had 30 seconds to reach their target, then earned credit for each second spent within a defined pace zone, with a personalized barcode receipt redeemable through a Shopify POS UI extension. The implementation used a curved, motorless TrueForm Trainer, FTMS messages, a Python relay, Socket.IO, a local Remix application, receipt printing, and a production-hosted POS integration. Interval timestamps were normalized because treadmill messages arrived irregularly, while a state machine coordinated warm-up, gameplay, operator controls, database updates, discounts, and printing. The resulting experience attracted new customers, with 63% of participants identified as new customers, and its patterns could support other sensor-driven in-store incentives.
Diffusers introduces support for FLUX-2 models through the Flux2Pipeline and Flux2Transformer2DModel classes. Running the 4-bit quantized checkpoint diffusers/FLUX.2-dev-bnb-4bit requires loading Mistral3ForConditionalGeneration as the text encoder and the transformer in bfloat16 precision with CPU offloading enabled. During image generation with a prompt and 50 inference steps, the pipeline encodes text embeddings through the Mistral 3 model before executing diffusion operations. However, executing the pipeline on a GPU with 14.56 GiB capacity triggers a CUDA OutOfMemoryError during 4-bit dequantization inside bitsandbytes matrix multiplication operations. Additionally, the execution logs warn that Flax classes are deprecated in Diffusers and will be removed in version 1.0.0.
OVHcloud is now integrated as a supported Inference Provider on the Hugging Face Hub, expanding serverless inference options across model pages and client SDKs. The integration enables access to open-weight models, including gpt-oss, Qwen3, DeepSeek R1, and Llama, using European infrastructure with pay-per-token pricing starting at €0.04 per million tokens. Developers can connect via Python and JavaScript SDKs using either direct custom API keys or automatic routing through Hugging Face tokens. The service supports structured outputs, function calling, multimodal workflows, and embedding models while providing sub-200ms first-token response times. Calls routed through Hugging Face pass through standard provider pricing without markups, and PRO tier subscribers receive monthly inference credits.
SpellVault began as Grab’s no-code platform for building LLM apps, using Retrieval-Augmented Generation (RAG) and plugins to connect applications with knowledge sources and external systems. Users could ground responses in Wikis, Google Docs, text, and PDFs, invoke custom HTTP endpoints, and access apps through the web, Slack, or APIs. The platform later added citations, Python execution for mathematical problems, scheduled actions, and drag-and-drop Workflows combining LLM calls, code, and Knowledge Vault lookups, while its executor moved toward graphs with nodes, edges, and states. SpellVault now exposes apps and RAG through MCP, allowing external agents and compatible clients to invoke apps and search, retrieve, or add Knowledge Vault information; TinyMCP adds MCP capabilities to FastAPI as a router.
Hugging Face TRL now officially integrates with RapidFire AI to accelerate LLM fine-tuning and post-training experimentation through concurrent configuration evaluation. Instead of executing training configurations sequentially, the platform shards datasets into discrete chunks and cycles multiple model configurations across GPUs at chunk boundaries. The runtime handles automatic checkpointing via a shared-memory-based adapter and model spilling mechanism to maintain consistent training state. Experimenters can monitor live metrics on an MLflow-based dashboard and use Interactive Control Ops to stop underperforming runs or clone and warm-start promising configurations mid-flight. Benchmark results on NVIDIA A100 GPUs demonstrate experimentation speedups ranging from 15x to 20x over sequential runs when training TinyLlama-1.1B and Llama-3.2-1B models.
Compiling custom deep learning GPU kernels across architectures often leads to complex build flag management, compiler errors, and ABI issues. Hugging Face's kernels library and kernel-builder streamline this workflow by supporting backends such as ROCm, CUDA, Metal, and XPU. Using the RadeonFlow FP8 block-wise GEMM kernel optimized for the AMD Instinct MI300X GPU as an example, developers organize files into specific headers and HIP implementations. The build is configured via a build.toml manifest and flake.nix to ensure reproducible compilation across supported PyTorch and ROCm versions. Artifacts can then be pushed to the Hugging Face Hub, allowing users to load and execute custom operators directly via get_kernel without traditional installation steps.
AMD, Hugging Face, and Data Monsters announced the AMD Open Robotics Hackathon, an in-person competition scheduled for Tokyo and Paris in December 2025. Participating teams of up to four adults will compete over three days across two core missions. The first mission covers an instructor-led session on configuring the LeRobot development environment using AMD AI solutions. During the second mission, teams spend two days developing a freestyle project to address a real-world problem using LeRobot. Participants receive access to SO-101 robotics kits, AMD Ryzen AI laptops, and AMD Instinct MI300X GPUs via AMD Developer Cloud, with prizes awarded to the top seven teams in each city based on creativity, difficulty, ease-of-use, and practicality.
Thomas Ptacek argues that people should build an LLM agent before forming strong opinions about the technology, because implementation reveals how simple and surprising the underlying system can be. The example starts with a Python loop around the OpenAI Responses API, storing user and assistant messages in a context list to simulate conversation with a stateless model. Adding a JSON-defined ping function and a tool-calling loop lets the model choose and execute multiple network checks, demonstrating behavior not explicitly hard-coded in the loop. The discussion extends this pattern to coding agents, contexts persisted in SQLite, sub-agents, and design choices involving nondeterminism, ground truth, interchange formats, and token costs. It concludes that these remain open software-engineering problems whose practical behavior can be understood by building and iterating on agents.
Simulation in healthcare robotics has historically been slow, siloed, and difficult to translate into real-world physical systems. The NVIDIA Isaac for Healthcare v0.4 release introduces an end-to-end SO-ARM starter workflow to streamline simulation, training, and deployment for embodied surgical assistants. The architecture relies on a Sim2Real mixed training approach that fine-tunes the GR00T N1.5 foundation model on combined real-world and synthetic datasets using LeRobot. Synthetic data generated in simulation constitutes over 93 percent of the policy training data to bridge physical data collection constraints. Real-time inference on the SO-ARM101 precision manipulator utilizes RTI DDS communication, dual-camera vision, and TensorRT model conversion.
Simulation in healthcare robotics has historically been slow, siloed, and difficult to translate to physical hardware. NVIDIA introduced the Isaac for Healthcare v0.4 developer framework to streamline this lifecycle through an end-to-end SO-ARM starter workflow. Developers collect mixed real-world and synthetic datasets using LeRobot and SO-101 teleoperation, with synthetic generation accounting for over 93 percent of training data. The pipeline post-trains GR00T N1.5 models using dual-camera vision inputs, evaluates policies in Isaac Lab, and deploys them to physical hardware with RTI DDS communication. This integrated approach allows surgical assistant robots to interpret natural language instructions and execute physical manipulation tasks reliably.
Training machine learning models on multi-terabyte datasets often requires long download times or suffers from network request storms when multiple DataLoader workers initialize independently. Hugging Face revamped the backend of its datasets library to make dataset streaming viable for large-scale distributed training without modifying the standard API. Startup latency was reduced by caching resolved data file lists across workers and bundling API calls, cutting initial request volume up to one hundred times. The team also implemented background prefetching for Parquet files and added configurable buffering parameters to keep GPUs fully saturated during training runs. Benchmark tests demonstrated up to twice the sample processing throughput and zero worker crashes across 256 concurrent workers on 64 H100 GPUs.
The Hugging Face Hub team released huggingface_hub v1.0, marking the library's transition into a mature foundation for open machine learning after five years of development. The major update migrates the underlying network backend to httpx and replaces the legacy hf_transfer tool with the hf_xet binary package to enable chunk-level file deduplication across repositories. In addition, the release introduces a redesigned Typer-based CLI using the streamlined hf command alongside explicit authentication functions and expanded inference primitives. Legacy components, including the Git-based Repository class and the older InferenceApi interface, have been removed to establish a cleaner and more maintainable architecture. Most dependent machine learning libraries remain compatible across versions, though transformers requires v0.x for version 4 and v1.x for its upcoming version 5 release.
LeRobot v0.4.0 expands the open-source robot-learning stack with scalable datasets, simulation benchmarks, processing tools, policies, and hardware integrations. LeRobotDataset v3.0 introduces chunked episodes, video streaming, unified Parquet metadata, improved loading and memory efficiency, plus utilities for editing and converting datasets. A modular Processor system separates policy and robot pipelines, while direct Accelerate integration simplifies multi-GPU training; the release also adds LIBERO, Meta-World, PI0, PI0.5, and GR00T N1.5 support. A plugin architecture enables third-party robots, cameras, and teleoperators to be installed without changing the core library, with Reachy 2 and phone teleoperation included, alongside a self-paced Robot Learning Course and hands-on tutorial.
Deploying Vision Language Models locally presents computational challenges despite providing data privacy and independence from external servers. Optimum Intel and OpenVINO address this by optimizing lightweight models like SmolVLM2-256M for low-resource hardware, including Intel CPUs and GPUs. The process involves exporting the model to the OpenVINO Intermediate Representation format, applying 8-bit weight-only or static quantization, and executing inference with the transformed model. In single-image CPU benchmarks on an Intel Core Ultra 7 265K processor, OpenVINO with 8-bit weight-only quantization reduced time to first token from 5.150 seconds under PyTorch down to 0.247 seconds. The optimized configuration also raised decoding throughput from 0.722 to 63.928 tokens per second.
Assessing AI-generated code via static inspection is error-prone and fails to reflect whether code functions correctly across real-world environments. BigCodeArena addresses this evaluation bottleneck as a human-in-the-loop platform that executes model outputs in real time inside isolated sandbox environments across ten programming languages and eight execution frameworks. Users interact directly with live applications, refine implementations through multi-turn conversations, and submit pairwise preference votes to generate Elo ratings via the Bradley-Terry model. In five months of community testing covering over 14,000 conversations, proprietary models including o3-mini and o1-mini led overall Elo rankings, while open models like Qwen2.5 and Llama-3.3-70B trailed closed competitors. The project has open-sourced its full evaluation pipelines, conversation datasets, and related benchmarks to support community-driven code generation assessment.
Running competitive models like RedNote's 3B parameter dots.ocr on-device provides zero-cost, network-free optical character recognition while leveraging power-efficient hardware like Apple's Neural Engine. Because the Neural Engine requires Core ML, converting the 1.2B parameter NaViT vision encoder from PyTorch requires resolving multiple graph tracing incompatibilities. The initial conversion pipeline targets FLOAT32 execution on GPU by capturing the execution graph with torch.jit.trace and compiling it via coremltools. Simplifying the model for single-image inference eliminates dynamic sequence masking, dynamic tensor iteration, and multi-attention complexity. Although the resulting Core ML model accurately matches PyTorch baseline numerical precision, the unoptimized artifact spans over 5GB and takes over one second per forward pass.
Local agentic AI workflows generate multi-step reasoning traces that increase token counts and strain real-time inference on personal computers. To accelerate execution, researchers implemented speculative decoding using OpenVINO.GenAI on an Intel Lunar Lake integrated GPU, pairing a 4-bit Qwen3-8B target model with a smaller Qwen3-0.6B draft model. By measuring angular distance across layers, the team pruned six of the draft model's twenty-eight layers to minimize draft latency and fine-tuned it on synthetic data generated from 500,000 prompts. This depth-pruned draft elevated speculative decoding throughput from a 1.3x speedup to a 1.4x speedup over the standalone baseline. Finally, deploying the optimized model alongside the Hugging Face smolagents framework allowed local agents to perform tool invocation and code generation tasks efficiently.
The best engineering reads, once a week.