SShortSingh.
Back to feed

OpenAI Python SDK streams hang or truncate after base_url switch

0
·1 views

Repointing the OpenAI Python SDK to a new base_url can leave blocking calls working while streaming calls hang, truncate, or fail with an IndexError on the final event. The article argues the switch changes the whole transport stack, including proxies, TLS terminators and CDNs with different buffering and timeout behaviour, not just the hostname. It warns that a stale OPENAI_BASE_URL environment variable can silently override the intended endpoint and make a key problem look like a 401. It recommends printing resolved configuration and using an API subdomain rather than a CDN-fronted apex, which may buffer responses. A diagnostic curl command and a Python probe measure time-to-first-token and chunk arrival to tell buffering apart from slow starts.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

A One-Line Homepage Request Lacks the Decisions Needed to Implement It

A request to help first-time visitors understand a product's workflow identifies a real problem but cannot safely be built as written. Terms like "first-time visitor" and "understand" leave room for several different interpretations that each lead to different work. The author argues that a brief should separate the current problem, link approved sources with clear versions and owners, and flag conflicting instructions for a human to resolve. Acceptance checks should cover the content, signed-in and signed-out behavior, links, and devices, since homepage changes can affect more than copy. Without these recorded decisions, the implementer must guess, and the request remains an idea rather than an executable task.

0
ProgrammingDEV Community ·

Disabling AMD nested virtualization as an interim fix for CVE-2026-99312

A hypervisor patch is the lasting remedy for CVE-2026-99312, but disabling nested virtualization is the recommended mitigation when a host cannot be rebooted into a fixed kernel right away. The flaw affects AMD KVM hosts where a guest can run an L2 virtual machine, since the INIT reset path mishandles the nested page table pointer in that state. Operators should first confirm they run AMD KVM and check the kvm_amd nested parameter, recording its prior value, because manual or image-based changes may have enabled it. Teams must also identify dependent workloads such as CI runners and virtual desktops, as disabling the feature can break applications or background workflows. After applying the change and ensuring it persists across reboots, operators should verify the running setting and test both blocked and ordinary VM operations through the real request path.

0
ProgrammingDEV Community ·

AirLLM Runs Huge Models on Small GPUs by Streaming Layers From Disk, at a Steep Speed Cost

AirLLM is an open-source tool that claims to run very large language models, including a 70B model on a 4GB graphics card, by avoiding the need to hold the whole model in GPU memory. It splits a model into per-layer files on disk and loads only one layer at a time during generation, with prefetching to overlap reads. Because the full model is re-read from disk for every generated token, output is extremely slow, with reported figures ranging from tens of seconds to several minutes per token. The project's release notes and issue tracker show that its memory savings come at the expense of speed, which makes it better suited to experimentation than everyday use. The article's authors argue that users should weigh this trade-off before adopting the tool.

0
ProgrammingDEV Community ·

Why Cybersecurity Tools Need Governance to Protect Developers and Organisations

Security tools alone leave gaps unless an organisation also defines who owns security decisions, what standards apply, and how accountability is maintained. Governance covers leadership roles, clear policies, compliance alignment with rules such as GDPR and India's DPDP Act, and risk-based priorities that guide what gets fixed first. Practical steps include CODEOWNERS files, a SECURITY.md vulnerability reporting policy, and automated checks in CI pipelines to enforce those policies. The article also recommends incident response planning, regular team training, and annual policy reviews, with the author noting that even small steps such as these can build a stronger security posture over time.