PythonHub
2.44K subscribers
2.35K photos
49.2K links
News & links about Python programming.
https://pythonhub.dev/
Download Telegram
Weaponizing image scaling against production AI systems

Attackers can hide malicious prompts in images that become visible only after being downscaled—tricking AI systems like Gemini CLI and Vertex AI Studio into executing hidden instructions. Trail of Bits demonstrates these “image scaling” exploits and introduces Anamorpher, an open-source tool to craft and test such attacks, while also proposing defenses.

https://blog.trailofbits.com/2025/08/21/weaponizing-image-scaling-against-production-ai-systems/
How to Build an Advanced AI Agent with Search (LangGraph, Python, Bright Data & More)

The video demonstrates building a multi-step, scalable AI research agent in Python using LangGraph. The agent can pull live search data from sources like Google, Bing, and Reddit, aggregate and analyze the information, and provide comprehensive answers, showcasing advanced Python coding, complex architecture, and effective use of APIs like Bright Data and OpenAI GPT. The tutorial covers ...

https://www.youtube.com/watch?v=cUC-hyjpNxk
From GPT-2 to gpt-oss: Analyzing the Architectural Advances

The article analyzes the architectural advances from GPT-2 to OpenAI’s new open-weight gpt-oss models, highlighting innovations like Mixture-of-Experts, grouped query attention, and sliding-window layers for efficiency and scaling. He compares these changes with models like Qwen3 and notes how gpt-oss is optimized for reasoning, tool use, and agentic workflows, while remaining memory-eff...

https://magazine.sebastianraschka.com/p/from-gpt-2-to-gpt-oss-analyzing-the
How to Write Great Unit Tests in Python

The video teaches how to write effective and maintainable unit tests in Python, focusing on practical techniques such as mocking, monkey patching, fixtures, and parametrization with pytest. It uses a realistic WeatherService example to demonstrate these concepts, emphasizing best practices for robust testing and improving code quality in production systems.

https://www.youtube.com/watch?v=EIV_ixKGPmc
oLLM

oLLM is a lightweight Python library for large-context LLM inference, built on top of Huggingface Transformers and PyTorch. It enables running models like Llama-3.1-8B-Instruct on 100k context using ~$200 consumer GPU with 8GB VRAM. Example performance: ~20 min for the first token, ~17s per subsequent token.

https://github.com/Mega4alik/ollm
TIL: Using SQLModel Asynchronously with FastAPI (and Air) with PostgreSQL

This post explains how to leverage SQLModel with FastAPI and PostgreSQL to enable fully asynchronous database operations, improving scalability and efficiency for concurrent web applications. Key steps include setting up async database engines and sessions, using dependency injection in FastAPI, and aligning everything with non-blocking patterns.

https://daniel.feldroy.com/posts/til-2025-08-using-sqlmodel-asynchronously-with-fastapi-and-air-with-postgresql
Elysia

Elysia is an agentic platform designed to use tools in a decision tree. A decision agent decides which tools to use dynamically based on its environment and context.

https://github.com/weaviate/elysia
Build an AI Coding Agent in Python

This tutorial teaches how to build a functional agentic AI coding assistant in Python using the free Gemini Flash API, covering agentic loops, tool-calling, file manipulation, and autonomous debugging. By constructing an agent that can read, modify, and execute code, viewers gain practical skills and deep insight into how modern coding agents operate beneath the surface.

https://www.youtube.com/watch?v=YtHdaXuOAks
playwright-use

playwright-use turns natural-language UI test goals into executable Playwright steps using AI, then produces human-friendly and machine-readable reports with screenshots, video, and traces.

https://pypi.org/project/playwright-use/
Python: capture stdout and stderr in unittest

The article explains how to capture stdout and stderr during Python unittest runs using contextlib.redirectstdout and redirectstderr, enabling tests to programmatically access console output. It also provides examples and custom context managers to simplify capturing both streams simultaneously, improving test logging and debugging capabilities.

https://adamj.eu/tech/2025/08/29/python-unittest-capture-stdout-stderr/