YouZum

Committee

AI, Committee, Notizie, Uncategorized

A Coding Guide to High-Quality Image Generation, Control, and Editing Using HuggingFace Diffusers

In this tutorial, we design a practical image-generation workflow using the Diffusers library. We start by stabilizing the environment, then generate high-quality images from text prompts using Stable Diffusion with an optimized scheduler. We accelerate inference with a LoRA-based latent consistency approach, guide composition with ControlNet under edge conditioning, and finally perform localized edits via inpainting. Also, we focus on real-world techniques that balance image quality, speed, and controllability. Copy CodeCopiedUse a different Browser !pip -q uninstall -y pillow Pillow || true !pip -q install –upgrade –force-reinstall “pillow<12.0” !pip -q install –upgrade diffusers transformers accelerate safetensors huggingface_hub opencv-python import os, math, random import torch import numpy as np import cv2 from PIL import Image, ImageDraw, ImageFilter from diffusers import ( StableDiffusionPipeline, StableDiffusionInpaintPipeline, ControlNetModel, StableDiffusionControlNetPipeline, UniPCMultistepScheduler, ) We prepare a clean and compatible runtime by resolving dependency conflicts and installing all required libraries. We ensure image processing works reliably by pinning the correct Pillow version and loading the Diffusers ecosystem. We also import all core modules needed for generation, control, and inpainting workflows. Copy CodeCopiedUse a different Browser def seed_everything(seed=42): random.seed(seed) np.random.seed(seed) torch.manual_seed(seed) torch.cuda.manual_seed_all(seed) def to_grid(images, cols=2, bg=255): if isinstance(images, Image.Image): images = [images] w, h = images[0].size rows = math.ceil(len(images) / cols) grid = Image.new(“RGB”, (cols*w, rows*h), (bg, bg, bg)) for i, im in enumerate(images): grid.paste(im, ((i % cols)*w, (i // cols)*h)) return grid device = “cuda” if torch.cuda.is_available() else “cpu” dtype = torch.float16 if device == “cuda” else torch.float32 print(“device:”, device, “| dtype:”, dtype) We define utility functions to ensure reproducibility and to organize visual outputs efficiently. We set global random seeds so our generations remain consistent across runs. We also detect the available hardware and configure precision to optimize performance on the GPU or CPU. Copy CodeCopiedUse a different Browser seed_everything(7) BASE_MODEL = “runwayml/stable-diffusion-v1-5” pipe = StableDiffusionPipeline.from_pretrained( BASE_MODEL, torch_dtype=dtype, safety_checker=None, ).to(device) pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config) if device == “cuda”: pipe.enable_attention_slicing() pipe.enable_vae_slicing() prompt = “a cinematic photo of a futuristic street market at dusk, ultra-detailed, 35mm, volumetric lighting” negative_prompt = “blurry, low quality, deformed, watermark, text” img_text = pipe( prompt=prompt, negative_prompt=negative_prompt, num_inference_steps=25, guidance_scale=6.5, width=768, height=512, ).images[0] We initialize the base Stable Diffusion pipeline and switch to a more efficient UniPC scheduler. We generate a high-quality image directly from a text prompt using carefully chosen guidance and resolution settings. This establishes a strong baseline for subsequent improvements in speed and control. Copy CodeCopiedUse a different Browser LCM_LORA = “latent-consistency/lcm-lora-sdv1-5” pipe.load_lora_weights(LCM_LORA) try: pipe.fuse_lora() lora_fused = True except Exception as e: lora_fused = False print(“LoRA fuse skipped:”, e) fast_prompt = “a clean product photo of a minimal smartwatch on a reflective surface, studio lighting” fast_images = [] for steps in [4, 6, 8]: fast_images.append( pipe( prompt=fast_prompt, negative_prompt=negative_prompt, num_inference_steps=steps, guidance_scale=1.5, width=768, height=512, ).images[0] ) grid_fast = to_grid(fast_images, cols=3) print(“LoRA fused:”, lora_fused) W, H = 768, 512 layout = Image.new(“RGB”, (W, H), “white”) draw = ImageDraw.Draw(layout) draw.rectangle([40, 80, 340, 460], outline=”black”, width=6) draw.ellipse([430, 110, 720, 400], outline=”black”, width=6) draw.line([0, 420, W, 420], fill=”black”, width=5) edges = cv2.Canny(np.array(layout), 80, 160) edges = np.stack([edges]*3, axis=-1) canny_image = Image.fromarray(edges) CONTROLNET = “lllyasviel/sd-controlnet-canny” controlnet = ControlNetModel.from_pretrained( CONTROLNET, torch_dtype=dtype, ).to(device) cn_pipe = StableDiffusionControlNetPipeline.from_pretrained( BASE_MODEL, controlnet=controlnet, torch_dtype=dtype, safety_checker=None, ).to(device) cn_pipe.scheduler = UniPCMultistepScheduler.from_config(cn_pipe.scheduler.config) if device == “cuda”: cn_pipe.enable_attention_slicing() cn_pipe.enable_vae_slicing() cn_prompt = “a modern cafe interior, architectural render, soft daylight, high detail” img_controlnet = cn_pipe( prompt=cn_prompt, negative_prompt=negative_prompt, image=canny_image, num_inference_steps=25, guidance_scale=6.5, controlnet_conditioning_scale=1.0, ).images[0] We accelerate inference by loading and fusing a LoRA adapter and demonstrate fast sampling with very few diffusion steps. We then construct a structural conditioning image and apply ControlNet to guide the layout of the generated scene. This allows us to preserve composition while still benefiting from creative text guidance. Copy CodeCopiedUse a different Browser mask = Image.new(“L”, img_controlnet.size, 0) mask_draw = ImageDraw.Draw(mask) mask_draw.rectangle([60, 90, 320, 170], fill=255) mask = mask.filter(ImageFilter.GaussianBlur(2)) inpaint_pipe = StableDiffusionInpaintPipeline.from_pretrained( BASE_MODEL, torch_dtype=dtype, safety_checker=None, ).to(device) inpaint_pipe.scheduler = UniPCMultistepScheduler.from_config(inpaint_pipe.scheduler.config) if device == “cuda”: inpaint_pipe.enable_attention_slicing() inpaint_pipe.enable_vae_slicing() inpaint_prompt = “a glowing neon sign that says ‘CAFÉ’, cyberpunk style, realistic lighting” img_inpaint = inpaint_pipe( prompt=inpaint_prompt, negative_prompt=negative_prompt, image=img_controlnet, mask_image=mask, num_inference_steps=30, guidance_scale=7.0, ).images[0] os.makedirs(“outputs”, exist_ok=True) img_text.save(“outputs/text2img.png”) grid_fast.save(“outputs/lora_fast_grid.png”) layout.save(“outputs/layout.png”) canny_image.save(“outputs/canny.png”) img_controlnet.save(“outputs/controlnet.png”) mask.save(“outputs/mask.png”) img_inpaint.save(“outputs/inpaint.png”) print(“Saved outputs:”, sorted(os.listdir(“outputs”))) print(“Done.”) We create a mask to isolate a specific region and apply inpainting to modify only that part of the image. We refine the selected area using a targeted prompt while keeping the rest intact. Finally, we save all intermediate and final outputs to disk for inspection and reuse. In conclusion, we demonstrated how a single Diffusers pipeline can evolve into a flexible, production-ready image generation system. We explained how to move from pure text-to-image generation to fast sampling, structural control, and targeted image editing without changing frameworks or tooling. This tutorial highlights how we can combine schedulers, LoRA adapters, ControlNet, and inpainting to create controllable and efficient generative pipelines that are easy to extend for more advanced creative or applied use cases. Check out the Full Codes here. Also, feel free to follow us on Twitter and don’t forget to join our 100k+ ML SubReddit and Subscribe to our Newsletter. Wait! are you on telegram? now you can join us on telegram as well. The post A Coding Guide to High-Quality Image Generation, Control, and Editing Using HuggingFace Diffusers appeared first on MarkTechPost.

A Coding Guide to High-Quality Image Generation, Control, and Editing Using HuggingFace Diffusers Leggi l'articolo »

AI, Committee, Notizie, Uncategorized

Measles cases are rising. Other vaccine-preventable infections could be next.

There’s a measles outbreak happening close to where I live. Since the start of this year, 34 cases have been confirmed in Enfield, a northern borough of London. Most of those affected are children under the age of 11. One in five have needed hospital treatment. It’s another worrying development for an incredibly contagious and potentially fatal disease. Since October last year, 962 cases of measles have been confirmed in South Carolina. Large outbreaks (with more than 50 confirmed cases) are underway in four US states. Smaller outbreaks are being reported in another 12 states. The vast majority of these cases have been children who were not fully vaccinated. Vaccine hesitancy is thought to be a significant reason children are missing out on important vaccines—the World Health Organization described it as one of the 10 leading threats to global health in 2019. And if we’re seeing more measles cases now, we might expect to soon see more cases of other vaccine-preventable infections, including some that can cause liver cancer or meningitis. Some people will always argue that measles is not a big deal—that infections used to be common, and most people survived them and did just fine. It is true that in most cases kids do recover well from the virus. But not always. Measles symptoms tend to start with a fever and a runny nose. The telltale rash comes later. In some cases, severe complications develop. They can include pneumonia, blindness, and inflammation of the brain. Some people won’t develop complications until years later. In rare cases, the disease can be fatal. Before the measles vaccine was introduced, in 1963, measles epidemics occurred every two to three years, according to the WHO. Back then, around 2.6 million people died from measles every year. Since it was introduced, the measles vaccine is thought to have prevented almost 59 million deaths. But vaccination rates have been lagging, says Anne Zink, an emergency medicine physician and clinical fellow at the Yale School of Public Health. “We’ve seen a slow decline in people who are willing to get vaccinated against measles for some time,” she says. “As we get more and more people who are at risk because they’re unvaccinated, the higher the chances that the disease can then spread and take off.” Vaccination rates need to be at 95% to prevent measles outbreaks. But rates are well below that level in some regions. Across South Carolina, the proportion of kindergartners who received both doses of the MMR vaccine, which protects against measles as well as mumps and rubella, has dropped steadily over the last five years, from 94% in 2020-2021 to 91% in 2024-2025. Some schools in the state have coverage rates as low as 20%, state epidemiologist Linda Bell told reporters last month. Vaccination rates are low in London, too. Fewer than 70% of children have received both doses of their MMR by the time they turn five, according to the UK Health Security Agency. In some boroughs, vaccination rates are as low as 58%. So perhaps it’s not surprising we’re seeing outbreaks. The UK is one of six countries to have lost their measles elimination status last month, along with Spain, Austria, Armenia, Azerbaijan, and Uzbekistan. Canada lost its elimination status last year. The highly contagious measles could be a bellwether for other vaccine-preventable diseases. Zink is already seeing signs. She points to a case of polio that paralyzed a man in New York in 2022. That happened when rates of polio vaccination were low, she says. “Polio is a great example of … a disease that is primarily asymptomatic, and most people don’t have any symptoms whatsoever, but for the people who do get symptoms, it can be life-threatening.” Then there’s mumps—another disease the MMR vaccine protects against. It’s another one of those infections that can be symptom-free and harmless in some, especially children, but nasty for others. It can cause a painful swelling of the testes, and other complications include brain swelling and deafness. (From my personal experience of being hospitalized with mumps, I can attest that even “mild” infections are pretty horrible.) Mumps is less contagious than measles, so we might expect a delay between an uptick in measles cases and the spread of mumps, says Zink. But she says that she’s more concerned about hepatitis B. “It lives on surfaces for a long period of time, and if you’re not vaccinated against it and you’re exposed to it as a kid, you’re at a really high risk of developing liver cancer and death,” she says. Zink was formerly chief medical officer of Alaska, a state that in the 1970s had the world’s highest rate of childhood liver cancer caused by hepatitis B. Screening and universal newborn vaccination programs eliminated the virus’s spread. Public health experts worry that the current US administration’s position on vaccines may contribute to the decline in vaccine uptake. Last month the US Centers for Disease Control and Prevention approved changes to childhood vaccination recommendations. The agency no longer recommends the hepatitis B vaccine for all newborns. The chair of the CDC’s vaccine advisory panel has also questioned broad vaccine recommendations for polio. Even vitamin injections are being refused by parents, says Zink. A shot of vitamin K at birth can help prevent severe bleeding in some babies. But recent research suggests that parents of 5% of newborns are refusing it (up from 2.9% in 2017). “I can’t tell you how many of my pediatric [doctor] friends have told me about having to care for a kiddo in the ICU with … bleeding into their brain because the kid didn’t get vitamin K at birth,” says Zink. “And that can kill kids, [or have] lifelong, devastating, stroke-like symptoms.” All this paints a pretty bleak picture for children’s health. But things can change. Vaccination can still offer protection to plenty of people at risk of infection. South Carolina’s Department of Public Health is offering free MMR vaccinations to residents at mobile clinics. “It’s easy to think ‘It’s not going to be me,’” says Zink. “Seeing kiddos

Measles cases are rising. Other vaccine-preventable infections could be next. Leggi l'articolo »

AI, Committee, Notizie, Uncategorized

NVIDIA Releases Dynamo v0.9.0: A Massive Infrastructure Overhaul Featuring FlashIndexer, Multi-Modal Support, and Removed NATS and ETCD

NVIDIA has just released Dynamo v0.9.0. This is the most significant infrastructure upgrade for the distributed inference framework to date. This update simplifies how large-scale models are deployed and managed. The release focuses on removing heavy dependencies and improving how GPUs handle multi-modal data. The Great Simplification: Removing NATS and etcd The biggest change in v0.9.0 is the removal of NATS and ETCD. In previous versions, these tools handled service discovery and messaging. However, they added ‘operational tax’ by requiring developers to manage extra clusters. NVIDIA replaced these with a new Event Plane and a Discovery Plane. The system now uses ZMQ (ZeroMQ) for high-performance transport and MessagePack for data serialization. For teams using Kubernetes, Dynamo now supports Kubernetes-native service discovery. This change makes the infrastructure leaner and easier to maintain in production environments. Multi-Modal Support and the E/P/D Split Dynamo v0.9.0 expands multi-modal support across 3 main backends: vLLM, SGLang, and TensorRT-LLM. This allows models to process text, images, and video more efficiently. A key feature in this update is the E/P/D (Encode/Prefill/Decode) split. In standard setups, a single GPU often handles all 3 stages. This can cause bottlenecks during heavy video or image processing. v0.9.0 introduces Encoder Disaggregation. You can now run the Encoder on a separate set of GPUs from the Prefill and Decode workers. This allows you to scale your hardware based on the specific needs of your model. Sneak Preview: FlashIndexer This release includes a sneak preview of FlashIndexer. This component is designed to solve latency issues in distributed KV cache management. When working with large context windows, moving Key-Value (KV) data between GPUs is a slow process. FlashIndexer improves how the system indexes and retrieves these cached tokens. This results in a lower Time to First Token (TTFT). While still a preview, it represents a major step toward making distributed inference feel as fast as local inference. Smart Routing and Load Estimation Managing traffic across 100s of GPUs is difficult. Dynamo v0.9.0 introduces a smarter Planner that uses predictive load estimation. The system uses a Kalman filter to predict the future load of a request based on past performance. It also supports routing hints from the Kubernetes Gateway API Inference Extension (GAIE). This allows the network layer to communicate directly with the inference engine. If a specific GPU group is overloaded, the system can route new requests to idle workers with higher precision. The Technical Stack at a Glance The v0.9.0 release updates several core components to their latest stable versions. Here is the breakdown of the supported backends and libraries: Component Version vLLM v0.14.1 SGLang v0.5.8 TensorRT-LLM v1.3.0rc1 NIXL v0.9.0 Rust Core dynamo-tokens crate The inclusion of the dynamo-tokens crate, written in Rust, ensures that token handling remains high-speed. For data transfer between GPUs, Dynamo continues to leverage NIXL (NVIDIA Inference Transfer Library) for RDMA-based communication. Key Takeaways Infrastructure Decoupling (Goodbye NATS and ETCD): The release completes the modernization of the communication architecture. By replacing NATS and ETCD with a new Event Plane (using ZMQ and MessagePack) and Kubernetes-native service discovery, the system removes the ‘operational tax’ of managing external clusters. Full Multi-Modal Disaggregation (E/P/D Split): Dynamo now supports a complete Encode/Prefill/Decode (E/P/D) split across all 3 backends (vLLM, SGLang, and TRT-LLM). This allows you to run vision or video encoders on separate GPUs, preventing compute-heavy encoding tasks from bottlenecking the text generation process. FlashIndexer Preview for Lower Latency :The ‘sneak preview’ of FlashIndexer introduces a specialized component to optimize distributed KV cache management. It is designed to make the indexing and retrieval of conversation ‘memory’ significantly faster, aimed at further reducing the Time to First Token (TTFT). Smarter Scheduling with Kalman Filters: The system now uses predictive load estimation powered by Kalman filters. This allows the Planner to forecast GPU load more accurately and handle traffic spikes proactively, supported by routing hints from the Kubernetes Gateway API Inference Extension (GAIE). Check out the GitHub Release here. Also, feel free to follow us on Twitter and don’t forget to join our 100k+ ML SubReddit and Subscribe to our Newsletter. Wait! are you on telegram? now you can join us on telegram as well. The post NVIDIA Releases Dynamo v0.9.0: A Massive Infrastructure Overhaul Featuring FlashIndexer, Multi-Modal Support, and Removed NATS and ETCD appeared first on MarkTechPost.

NVIDIA Releases Dynamo v0.9.0: A Massive Infrastructure Overhaul Featuring FlashIndexer, Multi-Modal Support, and Removed NATS and ETCD Leggi l'articolo »

AI, Committee, Notizie, Uncategorized

How to Build Transparent AI Agents: Traceable Decision-Making with Audit Trails and Human Gates

In this tutorial, we build a glass-box agentic workflow that makes every decision traceable, auditable, and explicitly governed by human approval. We design the system to log each thought, action, and observation into a tamper-evident audit ledger while enforcing dynamic permissioning for high-risk operations. By combining LangGraph’s interrupt-driven human-in-the-loop control with a hash-chained database, we demonstrate how agentic systems can move beyond opaque automation and align with modern governance expectations. Throughout the tutorial, we focus on practical, runnable patterns that turn governance from an afterthought into a first-class system feature. Copy CodeCopiedUse a different Browser !pip -q install -U langgraph langchain-core openai “pydantic<=2.12.3” import os import json import time import hmac import hashlib import secrets import sqlite3 import getpass from typing import Any, Dict, List, Optional, Literal, TypedDict from openai import OpenAI from langchain_core.messages import SystemMessage, HumanMessage, AIMessage from langgraph.graph import StateGraph, END from langgraph.types import interrupt, Command if not os.getenv(“OPENAI_API_KEY”): os.environ[“OPENAI_API_KEY”] = getpass.getpass(“Enter OpenAI API Key: “) client = OpenAI() MODEL = “gpt-5” We install all required libraries and import the core modules needed for agentic workflows and governance. We securely collect the OpenAI API key through a terminal prompt to avoid hard-coding secrets in the notebook. We also initialize the OpenAI client and define the model that drives the agent’s reasoning loop. Copy CodeCopiedUse a different Browser CREATE_SQL = “”” CREATE TABLE IF NOT EXISTS audit_log ( id INTEGER PRIMARY KEY AUTOINCREMENT, ts_unix INTEGER NOT NULL, actor TEXT NOT NULL, event_type TEXT NOT NULL, payload_json TEXT NOT NULL, prev_hash TEXT NOT NULL, row_hash TEXT NOT NULL ); CREATE TABLE IF NOT EXISTS ot_tokens ( token_id TEXT PRIMARY KEY, token_hash TEXT NOT NULL, purpose TEXT NOT NULL, expires_unix INTEGER NOT NULL, used INTEGER NOT NULL DEFAULT 0 ); “”” def _sha256_hex(s: bytes) -> str: return hashlib.sha256(s).hexdigest() def _canonical_json(obj: Any) -> str: return json.dumps(obj, sort_keys=True, separators=(“,”, “:”), ensure_ascii=False) class AuditLedger: def __init__(self, path: str = “glassbox_audit.db”): self.conn = sqlite3.connect(path, check_same_thread=False) self.conn.executescript(CREATE_SQL) self.conn.commit() def _last_hash(self) -> str: row = self.conn.execute(“SELECT row_hash FROM audit_log ORDER BY id DESC LIMIT 1”).fetchone() return row[0] if row else “GENESIS” def append(self, actor: str, event_type: str, payload: Any) -> int: ts = int(time.time()) prev_hash = self._last_hash() payload_json = _canonical_json(payload) material = f”{ts}|{actor}|{event_type}|{payload_json}|{prev_hash}”.encode(“utf-8”) row_hash = _sha256_hex(material) cur = self.conn.execute( “INSERT INTO audit_log (ts_unix, actor, event_type, payload_json, prev_hash, row_hash) VALUES (?, ?, ?, ?, ?, ?)”, (ts, actor, event_type, payload_json, prev_hash, row_hash), ) self.conn.commit() return cur.lastrowid def fetch_recent(self, limit: int = 50) -> List[Dict[str, Any]]: rows = self.conn.execute( “SELECT id, ts_unix, actor, event_type, payload_json, prev_hash, row_hash FROM audit_log ORDER BY id DESC LIMIT ?”, (limit,), ).fetchall() out = [] for r in rows[::-1]: out.append({ “id”: r[0], “ts_unix”: r[1], “actor”: r[2], “event_type”: r[3], “payload”: json.loads(r[4]), “prev_hash”: r[5], “row_hash”: r[6], }) return out def verify_integrity(self) -> Dict[str, Any]: rows = self.conn.execute( “SELECT id, ts_unix, actor, event_type, payload_json, prev_hash, row_hash FROM audit_log ORDER BY id ASC” ).fetchall() if not rows: return {“ok”: True, “rows”: 0, “message”: “Empty ledger.”} expected_prev = “GENESIS” for (id_, ts, actor, event_type, payload_json, prev_hash, row_hash) in rows: if prev_hash != expected_prev: return {“ok”: False, “at_id”: id_, “reason”: “prev_hash mismatch”} material = f”{ts}|{actor}|{event_type}|{payload_json}|{prev_hash}”.encode(“utf-8”) expected_hash = _sha256_hex(material) if not hmac.compare_digest(expected_hash, row_hash): return {“ok”: False, “at_id”: id_, “reason”: “row_hash mismatch”} expected_prev = row_hash return {“ok”: True, “rows”: len(rows), “message”: “Hash chain valid.”} ledger = AuditLedger() We design a hash-chained SQLite ledger that records every agent and system event in an append-only manner. We ensure each log entry cryptographically links to the previous one, making post-hoc tampering detectable. We also provide utilities to inspect recent events and verify the integrity of the entire audit chain. Copy CodeCopiedUse a different Browser def mint_one_time_token(purpose: str, ttl_seconds: int = 600) -> Dict[str, str]: token_id = secrets.token_hex(12) token_plain = secrets.token_urlsafe(20) token_hash = _sha256_hex(token_plain.encode(“utf-8”)) expires = int(time.time()) + ttl_seconds ledger.conn.execute( “INSERT INTO ot_tokens (token_id, token_hash, purpose, expires_unix, used) VALUES (?, ?, ?, ?, 0)”, (token_id, token_hash, purpose, expires), ) ledger.conn.commit() return {“token_id”: token_id, “token_plain”: token_plain, “purpose”: purpose, “expires_unix”: str(expires)} def consume_one_time_token(token_id: str, token_plain: str, purpose: str) -> bool: row = ledger.conn.execute( “SELECT token_hash, purpose, expires_unix, used FROM ot_tokens WHERE token_id = ?”, (token_id,), ).fetchone() if not row: return False token_hash_db, purpose_db, expires_unix, used = row if used == 1: return False if purpose_db != purpose: return False if int(time.time()) > int(expires_unix): return False token_hash_in = _sha256_hex(token_plain.encode(“utf-8”)) if not hmac.compare_digest(token_hash_in, token_hash_db): return False ledger.conn.execute(“UPDATE ot_tokens SET used = 1 WHERE token_id = ?”, (token_id,)) ledger.conn.commit() return True def tool_financial_transfer(amount_usd: float, to_account: str) -> Dict[str, Any]: return {“status”: “success”, “transfer_id”: “tx_” + secrets.token_hex(6), “amount_usd”: amount_usd, “to_account”: to_account} def tool_rig_move(rig_id: str, direction: Literal[“UP”, “DOWN”], meters: float) -> Dict[str, Any]: return {“status”: “success”, “rig_event_id”: “rig_” + secrets.token_hex(6), “rig_id”: rig_id, “direction”: direction, “meters”: meters} We implement a secure, single-use token mechanism that enables human approval for high-risk actions. We generate time-limited tokens, store only their hashes, and invalidate them immediately after use. We also define simulated restricted tools that represent sensitive operations such as financial transfers or physical rig movements. Copy CodeCopiedUse a different Browser RestrictedTool = Literal[“financial_transfer”, “rig_move”, “none”] class GlassBoxState(TypedDict): messages: List[Any] proposed_tool: RestrictedTool tool_args: Dict[str, Any] last_observation: Optional[Dict[str, Any]] SYSTEM_POLICY = “””You are a governance-first agent. You MUST propose actions in a structured JSON format with these keys: – thought – action – args Return ONLY JSON.””” def llm_propose_action(messages: List[Any]) -> Dict[str, Any]: input_msgs = [{“role”: “system”, “content”: SYSTEM_POLICY}] for m in messages: if isinstance(m, SystemMessage): input_msgs.append({“role”: “system”, “content”: m.content}) elif isinstance(m, HumanMessage): input_msgs.append({“role”: “user”, “content”: m.content}) elif isinstance(m, AIMessage): input_msgs.append({“role”: “assistant”, “content”: m.content}) resp = client.responses.create(model=MODEL, input=input_msgs) txt = resp.output_text.strip() try: return json.loads(txt) except Exception: return {“thought”: “fallback”, “action”: “ask_human”, “args”: {}} def node_think(state: GlassBoxState) -> GlassBoxState: proposal = llm_propose_action(state[“messages”]) ledger.append(“agent”, “THOUGHT”, {“thought”: proposal.get(“thought”)}) ledger.append(“agent”, “ACTION”, proposal) action = proposal.get(“action”, “no_op”) args = proposal.get(“args”, {}) if action in [“financial_transfer”, “rig_move”]: state[“proposed_tool”] = action state[“tool_args”] = args else: state[“proposed_tool”] = “none” state[“tool_args”] = {} return state def node_permission_gate(state: GlassBoxState) -> GlassBoxState: if state[“proposed_tool”] == “none”: return state token = mint_one_time_token(state[“proposed_tool”]) payload = {“token_id”: token[“token_id”], “token_plain”: token[“token_plain”]} human_input = interrupt(payload) state[“tool_args”][“_token_id”] = token[“token_id”] state[“tool_args”][“_human_token_plain”] = str(human_input) return state

How to Build Transparent AI Agents: Traceable Decision-Making with Audit Trails and Human Gates Leggi l'articolo »

AI, Committee, Notizie, Uncategorized

Job titles of the future: Breast biomechanic

Twenty years ago, Joanna Wakefield-Scurr was having persistent pain in her breasts. Her doctor couldn’t diagnose the cause but said a good, supportive bra could help. A professor of biomechanics, Wakefield-Scurr thought she could do a little research and find a science-backed option. Two decades later, she’s still looking. Wakefield-Scurr now leads an 18-person team at the Research Group in Breast Health at the University of Portsmouth in the UK. Their research shows that the most effective high-impact-sports bras have underwires, padded cups, adjustable underbands and shoulder straps, and hook-and-eye closures. These bras reduce breast movement by up to 74% when compared with wearing no bra. But movement might not be the only metric that matters. A biological rarity Few anatomical structures hang outside of the body unsupported by cartilage, muscle, or bone—meaning there wasn’t much historical research to build on. Wakefield-Scurr’s lab was the first to find that when women run, the motion of the torso causes breasts to move in a three-dimensional pattern—swinging side to side and up and down—as well as moving forward and backward. In an hour of slow jogging, boobs can bounce approximately 10,000 times. A sports necessity Wearing a bra that’s too tight can limit breathing. Wearing one that’s too loose can create back, shoulder, and neck pain. Pain can also be caused by the lag between torso and breast movement, which causes what is scientifically known as “breast slap.” The lab’s research has also found that the physical discomfort of bad bras, combined with the embarrassment of flopping around, is the one of the biggest barriers to exercise for women and that if women have a good sports bra, they’re more willing to go for a run. An open question Some bras function by deliberately compressing breasts. Others encapsulate and support each individual breast. But scientists still don’t know whether it’s more biomechanically important to reduce the breasts’ motion entirely, to reduce the speed at which they move, or to reduce breast slap. Will women constantly be forced to choose between the comfort of a stretchier bra and the support of a more restrictive one? Wakefield-Scurr is excited about new materials she’s tested that tighten or stretch depending on how you move. She’s working with fabric manufacturers and clothing companies to try out their wares. As more women take up high-impact sports, the need to understand what makes a good bra grows. Wakefield-Scurr says her lab can’t keep up with demand. Their cups runneth over. Sara Harrison is a freelance journalist who writes about science, technology, and health.

Job titles of the future: Breast biomechanic Leggi l'articolo »

AI, Committee, Notizie, Uncategorized

Community service

The bird is a beautiful silver-gray, and as she dies twitching in the lasernet I’m grateful for two things: First, that she didn’t make a sound. Second, that this will be the very last time.  They’re called corpse doves—because the darkest part of their gray plumage surrounds the lighter part, giving the impression that skeleton faces are peeking out from behind trash cans and bushes—and their crime is having the ability to carry diseases that would be compatible with humans. I open my hand, triggering the display from my imprinted handheld, and record an image to verify the elimination. A ding from my palm lets me know I’ve reached my quota for the day and, with that, the year. I’m tempted to give this one a send-off, a real burial with holy words and some flowers, but then I hear a pack of streetrats hooting beside me. My city-issued vest is reflective and nanopainted so it projects a slight glow. I don’t know if it’s to keep us safe like they say, or if it’s just that so many of us are ex-cons working court-ordered labor, and civilians want to be able to keep an eye on us. Either way, everyone treats us like we’re invisible—everyone except children. I switch the lasernet on the bird from electrocute to incinerate and watch as what already looked like a corpse becomes ashes. “Hey, executioner!” says a girl. “Executioner” is not my official title. The branch of city government we work for is called the Department of Mercy, and we’re only ever called technicians. But that doesn’t matter to the child, who can’t be more than eight but has the authority of a judge as she holds up a finger to point me out to her friends. HENRY HORENSTEIN “Guys, look!” she says, then turns her attention to me. “You hunting something big?” I shake my head, slowly packing up my things. “Something small?” she asks. Then her eyes darken. “You’re not a cat killer, are you?” “No,” I say quickly. “I do horseflies.” I don’t know why I lied, but as the suspicion leaves her face and a smile returns, I’m glad I did. “You should come down by the docks. We’ve got flies! Make your quota in a day.” The girl tosses her hair, making the tinfoil charms she’s wrapped around her braids tinkle like wind chimes.  “It’s my last day. But if I get flies again for next year, I’ll swing by.” Another lie, because we both know the city would never send anyone to the docks for flies. Flies are killed because they are a nuisance, which means people only care about clearing them out of suburbs and financial districts. They’d only send a tech down to the docks to kill something that put the city proper at risk through disease, or by using up more resources than they wanted to spare. LeeLee is expecting me home to sit through the reassignments with her and it’s already late, so I hand out a couple of the combination warming and light sticks I get for winter to the pack of children with nowhere to go. As I walk away, the children are laughing so loud it sounds like screaming. They toss the sticks in the air like signal flares, small bright cries for help that no one will see. LeeLee’s anxiety takes the form of caretaking, and as soon as I’ve stepped through the door I can smell bread warming and soup on the stove. I take off my muffling boots. Another day, I’d leave them on and sneak up on her just to be irritating, and she’d turn and threaten me with whatever kitchen utensil was at hand. But she’ll be extra nervous today, so I remove the shoes that let me catch nervous birds, and step hard on my way in. Sometimes it seems impossible that I can spend a year killing every fragile and defenseless thing I’ve encountered but still take such care with Lee. But I tell myself that the killing isn’t me—it’s just my sentence, and what I do when I have a choice is the only thing that really says anything about me. For the first six months and 400 birds, I believed it. LeeLee flicks on a smile that lasts a whole three seconds when she sees me, then clouds over again. “Soup’s too thin. There wasn’t enough powder for a real broth.” “I like thin soup,” I say. “Not like this. It doesn’t even cover up the taste of the water.” “I like the taste of the water,” I say, which breaks her out of her spiraling enough to roll her eyes. I put my hands on her shoulder to stop her fussing.  “The soup is going to be fine,” I say. “So will the reassignment.” I’m not much taller than she is, but when we met in juvie she hadn’t hit her last growth spurt yet, so she still tilts her head back to look me in the eyes. “What if it’s not?” “It will—” “What if you get whatever assignment Jordan got?” There it is. Because two of us didn’t leave juvie together to start community service—three of us did. But Jordan didn’t last three weeks into his assignment before he turned his implements inward. I notice she doesn’t say What if  I get what Jordan got? Because LeeLee is more afraid of being left alone than of having to kill something innocent. “We don’t know what his assignment was,” I say. It’s true, but we do know it was bad. Two weeks into our first stretch, a drug meant to sterilize the city’s feral cat population accidentally had the opposite effect. Everyone was pulled off their assigned duty for three days to murder litters of new kittens instead. It nearly broke me and Lee, but Jordan seemed almost grateful. “Besides, we don’t know if his assignment had anything to do with … what he did. You’re borrowing trouble.

Community service Leggi l'articolo »

AI, Committee, Notizie, Uncategorized

From integration chaos to digital clarity: Nutrien Ag Solutions’ post-acquisition reset

Thank you for joining us on the “Enterprise AI hub.” In this episode of the Infosys Knowledge Institute Podcast, Dylan Cosper speaks with Sriram Kalyan, head of applications and data at Nutrien Ag Solutions, Australia, about turning a high-risk post-acquisition IT landscape into a scalable digital foundation. Sriram shares how the merger of two major Australian agricultural companies created duplicated systems, fragile integrations, and operational risk, compounded by the sudden loss of key platform experts and partners. He explains how leadership alignment, disciplined platform consolidation, and a clear focus on business outcomes transformed integration from an invisible liability into a strategic enabler, positioning Nutrien Ag Solutions for future growth, cloud transformation, and enterprise scale. Click here to continue.

From integration chaos to digital clarity: Nutrien Ag Solutions’ post-acquisition reset Leggi l'articolo »

AI, Committee, Notizie, Uncategorized

What it takes to make agentic AI work in retail

Thank you for joining us on the “Enterprise AI hub.” In this episode of the Infosys Knowledge Institute Podcast, Dylan Cosper speaks with Prasad Banala, director of software engineering at a large US-based retail organization, about operationalizing agentic AI across the software development lifecycle. Prasad explains how his team applies AI to validate requirements, generate and analyze test cases, and accelerate issue resolution, while maintaining strict governance, human-in-the-loop review, and measurable quality outcomes. Click here to continue.

What it takes to make agentic AI work in retail Leggi l'articolo »

AI, Committee, Notizie, Uncategorized

How uncrewed narco subs could transform the Colombian drug trade

On a bright morning last April, a surveillance plane operated by the Colombian military spotted a 40-foot-long shark-like silhouette idling in the ocean just off Tayrona National Park. It was, unmistakably, a “narco sub,” a stealthy fiberglass vessel that sails with its hull almost entirely underwater, used by drug cartels to move cocaine north. The plane’s crew radioed it in, and eventually nearby coast guard boats got the order, routine but urgent: Intercept. In Cartagena, about 150 miles from the action, Captain Jaime González Zamudio, commander of the regional coast guard group, sat down at his desk to watch what happened next. On his computer monitor, icons representing his patrol boats raced toward the sub’s coordinates as updates crackled over his radio from the crews at sea. This was all standard; Colombia is the world’s largest producer of cocaine, and its navy has been seizing narco subs for decades. And so the captain was pretty sure what the outcome would be. His crew would catch up to the sub, just a bit of it showing above the water’s surface. They’d bring it to heel, board it, and force open the hatch to find two, three, maybe four exhausted men suffocating in a mix of diesel fumes and humidity, and a cargo compartment holding several tons of cocaine. The boats caught up to the sub. A crew boarded, forced open the hatch, and confirmed that the vessel was secure. But from that point on, things were different. First, some unexpected details came over the radio: There was no cocaine on board. Neither was there a crew, nor a helm, nor even enough room for a person to lie down. Instead, inside the hull the crew found a fuel tank, an autopilot system and control electronics, and a remotely monitored security camera. González Zamudio’s crew started sending pictures back to Cartagena: Bolted to the hull was another camera, as well as two plastic rectangles, each about the size of a cookie sheet—antennas for connecting to Starlink satellite internet. The authorities towed the boat back to Cartagena, where military techs took a closer look. Weeks later, they came to an unsettling conclusion: This was Colombia’s first confirmed uncrewed narco sub. It could be operated by remote control, but it was also capable of some degree of autonomous travel. The techs concluded that the sub was likely a prototype built by the Clan del Golfo, a powerful criminal group that operates along the Caribbean coast. For decades, handmade narco subs have been some of the cocaine trade’s most elusive and productive workhorses, ferrying multi-ton loads of illicit drugs from Colombian estuaries toward markets in North America and, increasingly, the rest of the world. Now off-the-shelf technology—Starlink terminals, plug-and-play nautical autopilots, high-resolution video cameras—may be advancing that cat-and-mouse game into a new phase. Uncrewed subs could move more cocaine over longer distances, and they wouldn’t put human smugglers at risk of capture. Law enforcement around the world is just beginning to grapple with what the Tayrona sub means for the future—whether it was merely an isolated experiment or the opening move in a new era of autonomous drug smuggling at sea. Drug traffickers love the ocean. “You can move drug traffic through legal and illegal routes,” says Juan Pablo Serrano, a captain in the Colombian navy and head of the operational coordination center for Orión, a multiagency, multinational counternarcotics effort. The giant container ships at the heart of global commerce offer a favorite approach, Serrano says. Bribe a chain of dockworkers and inspectors, hide a load in one of thousands of cargo boxes, and put it on a totally legal commercial vessel headed to Europe or North America. That route is slow and expensive—involving months of transit and bribes spread across a wide network—but relatively low risk. “A ship can carry 5,000 containers. Good luck finding the right one,” he says. Far less legal, but much faster and cheaper, are small, powerful motorboats. Quick to build and cheap to crew, these “go-fasts” top out at just under 50 feet long and can move smaller loads in hours rather than days. But they’re also easy for coastal radars and patrols to spot. Submersibles—or, more accurately, “semisubmersibles”—fit somewhere in the middle. They take more money and engineering to build than an open speedboat, but they buy stealth—even if a bit of the vessel rides at the surface, the bulk stays hidden underwater. That adds another option to a portfolio that smugglers constantly rebalance across three variables: risk, time, and cost. When US and Colombian authorities tightened control over air routes and commercial shipping in the early 1990s, subs became more attractive. The first ones were crude wooden hulls with a fiberglass shell and extra fuel tanks, cobbled together in mangrove estuaries, hidden from prying eyes. Today’s fiberglass semisubmersible designs ride mostly below the surface, relying on diesel engines that can push multi-ton loads for days at a time while presenting little more than a ripple and a hot exhaust pipe to radar and infrared sensors. A typical semisubmersible costs under $2 million to build and can carry three metric tons of cocaine. That’s worth over $160 million in Europe—wholesale. Most ferry between South American coasts and handoff points in Central America and Mexico, where allied criminal organizations break up the cargo and slowly funnel it toward the US. But some now go much farther. In 2019, Spanish authorities intercepted a semisubmersible after a 27-day transatlantic voyage from Brazil. In 2024, police in the Solomon Islands found the first narco sub in the Asia-Pacific region, a semisubmersible probably originating from Colombia on its way to Australia or New Zealand. If the variables are risk, time, and cost, then the economics of a narco sub are simple. Even if they spend more time on the water than a powerboat, they’re less likely to get caught—and a relative bargain to produce. A narco sub might cost between $1 million and $2 million to build, but a kilo of cocaine costs

How uncrewed narco subs could transform the Colombian drug trade Leggi l'articolo »

AI, Committee, Notizie, Uncategorized

The building legal case for global climate justice

The United States and the European Union grew into economic superpowers by committing climate atrocities. They have burned a wildly disproportionate share of the world’s oil and gas, planting carbon time bombs that will detonate first in the poorest, hottest parts of the globe.  Meanwhile, places like the Solomon Islands and Chad—low-lying or just plain sweltering—have emitted relatively little carbon dioxide, but by dint of their latitude and history, they rank among the countries most vulnerable to the fiercest consequences of global warming. That means increasingly devastating cyclones, heat waves, famines, and floods. Morally, there’s an ironclad case that the countries or companies responsible for this mess should provide compensation for the homes that will be destroyed, the shorelines that will disappear beneath rising seas, and the lives that will be cut short. By one estimate, the major economies owe a climate debt to the rest of the world approaching $200 trillion in reparations. Legally, though, the case has been far harder to make. Even putting aside the jurisdictional problems, early climate science couldn’t trace the provenance of airborne molecules of carbon dioxide across oceans and years. Deep-pocketed corporations with top-tier legal teams easily exploited those difficulties.  Now those tides might be turning. More climate-related lawsuits are getting filed, particularly in the Global South. Governments, nonprofits, and citizens in the most climate-exposed nations continue to test new legal arguments in new courts, and some of those courts are showing a new willingness to put nations and their industries on the hook as a matter of human rights. In addition, the science of figuring out exactly who is to blame for specific weather disasters, and to what degree, is getting better and better.  It’s true that no court has yet held any climate emitter liable for climate-related damages. For starters, nations are generally immune from lawsuits originating in other countries. That’s why most cases have focused on major carbon producers. But they’ve leaned on a pretty powerful defense.  While oil and gas companies extract, refine, and sell the world’s fossil fuels, most of the emissions come out of “the vehicles, power plants, and factories that burn the fuel,” as Michael Gerrard and Jessica Wentz, of Columbia Law School’s Sabin Center, note in a recent piece in Nature. In other words, companies just dig the stuff up. It’s not their fault someone else sets it on fire. So victims of extreme weather events continue to try new legal avenues and approaches, backed by ever-more-convincing science. Plaintiffs in the Philippines recently sued the oil giant Shell over its role in driving Super Typhoon Odette, a 2021 storm that killed more than 400 people and displaced nearly 800,000. The case relies partially on an attribution study that found climate change made extreme rainfall like that seen in Odette twice as likely.  IVAN JOESEFF GUIWANON/GREENPEACE Overall, evidence of corporate culpability—linking a specific company’s fossil fuel to a specific disaster—is getting easier to find. For example, a study published in Nature in September was able to determine how much particular companies contributed to a series of 21st-century heat waves. A number of recent legal decisions signal improving odds for these kinds of suits. Notably, a handful of determinations in climate cases before the European Court of Human Rights affirmed that states have legal obligations to protect people from the effects of climate change. And though it dismissed the case of a Peruvian farmer who sued a German power company over fears that a melting alpine glacier could destroy his property, a German court determined that major carbon polluters could in principle be found liable for climate damages tied to their emissions.  At least one lawsuit has already emerged that could test that principle: Dozens of Pakistani farmers whose land was deluged during the massive flooding events of 2022 have sued a pair of major German power and cement companies. Even if the lawsuit fails, that would be a problem with the system, not the science. Major carbon-polluting countries and companies have a disproportionate responsibility for climate-change-powered disasters.  Wealthy nations continued to encourage business practices that pollute the atmosphere, even as the threat of climate change grew increasingly grave. And oil and gas companies remain the kingpin suppliers to a fossil-fuel-addicted world. They have operated with the full knowledge of the massive social, environmental, and human cost imposed by their business while lobbying fiercely against any rules that would force them to pay for those harms or clean up their act.  They did it. They knew. In a civil society where rule of law matters, they should pay the price.  This article is from The Spark, MIT Technology Review’s weekly climate newsletter. To receive it in your inbox every Wednesday, sign up here.

The building legal case for global climate justice Leggi l'articolo »

We use cookies to improve your experience and performance on our website. You can learn more at Politica sulla privacy and manage your privacy settings by clicking Settings.

Privacy Preferences

You can choose your cookie settings by turning on/off each type of cookie as you wish, except for essential cookies.

Allow All
Manage Consent Preferences
  • Always Active

Save
it_IT