2025-11-22 06:00:55
CinemaSins just dropped a cheeky, rapid-fire roast of the new KPop Demon Hunters movie, calling out every over-the-top moment and plot quirk—yet embracing the film’s sheer fun and spectacle as they tally up the sins.
Hungry for more? They’ve got a loaded Linktree, Patreon page and immortal polls to fill out, plus Discord and Reddit hangouts. Don’t forget to follow the sin-squad (Jeremy, Chris, Aaron, Jonathan, Deneé, Ian & Daniel) on Twitter and Instagram for your daily dose of movie nitpicks.
Watch on YouTube
2025-11-22 05:49:32
To understand how modern Large Language Models (LLMs) like ChatGPT work, we must first understand the architecture that changed everything: the Transformer. Before we dive into the complex layers, we need to establish why we moved away from previous methods and how the model initially processes language.
Before the "Attention Is All You Need" paper, the standard for processing sequential data (like text) was the Recurrent Neural Network (RNN).In an RNN, data is processed sequentially. We give the network an initial state (State 0) along with an input x1 to produce an output y1 and a hidden state. This hidden state is passed forward to the next step, allowing the network to "remember" previous inputs.
While intuitive, RNNs suffer from severe limitations, specifically slow computation for long sequences and the vanishing or exploding gradient problem.
To understand this, let's look at calculus, specifically the Chain Rule.
If we have a composite function
In a deep neural network, backpropagation involves multiplying gradients layer by layer (like the chain rule). If we have many layers, we are essentially multiplying many numbers together.
Imagine multiplying fractions like:
As the number of layers (or time steps) increases, this number becomes infinitesimally small ("vanishes") or massively large ("explodes"). This makes it incredibly difficult for the model to access or learn from information that appeared early in a long sequence.
The Transformer abandons recurrence entirely, relying instead on an Encoder-Decoder architecture. It processes the entire sequence at once, which solves the speed and long-term dependency issues of RNNs.
Let's look at how data enters the model.
If we have an input sentence of length 6 (Sequence Length) and a model dimension (
Each row represents a word, and the columns (length 512) represent that word as a vector. You might ask: Why 512 dimensions?
We need high-dimensional space to capture:
Computers don't understand strings; they understand numbers. We take our original sentence:
"Your cat is a lovely cat"
First, we map these to Input IDs (their position in the vocabulary):
We then map these IDs into a vector of size 512. Note that these vectors are not fixed; they are learned parameters that change during training to better represent the word's meaning.
Since the Transformer processes words in parallel (not sequentially like an RNN), it has no inherent concept of "order." It doesn't know that "Your" comes before "cat." We must inject this information manually using Positional Encodings.
We want the model to treat words that appear close to each other as "close" mathematically. To do this, we use trigonometric functions because they naturally represent continuous patterns that the model can easily learn to extrapolate.
We add this positional vector to our embedding vector. The formula used in the paper is:
This ensures that every position has a unique encoding that is consistent across training and inference.
This is the "magic" of the architecture. Self-attention allows the model to relate words to each other within the same sentence. It determines how much "focus" the word "lovely" should have on the word "cat."
The formula for Scaled Dot-Product Attention is:
Where:
For a sequence length of 6 and dimension 512:
This (6 × 6) matrix captures the interaction between every word and every other word. When we multiply this by V, we get a weighted sum of the values, where the weights are determined by the compatibility of the Query and Key.
Key Benefits of Self-Attention:
Key Benefits of Self-Attention:
We have successfully moved away from the sequential limitations of RNNs and embraced the parallel nature of Transformers. We've learned how to convert text into meaningful vector spaces, inject order using positional encoding, and, most importantly, derive the mathematical foundation of how words "pay attention" to each other using Queries, Keys, and Values.
But there is a catch.
The mechanism we just described, a single pass of
Real-world language is too complex for a single "gaze." To build a model like ChatGPT, we need it to look at the sentence through multiple lenses simultaneously.
In Part 2, we will take the self-attention mechanism and clone it, creating Multi-Head Attention. We will then see how these attention scores are processed through Feed-Forward Networks to finally construct the complete Transformer block.
Stay tuned.
2025-11-22 05:49:20
In this workshop, I will guide you step by step how to build a Blue-Green deployment pipeline with AWS pipeline and deploys on AWS ECS with EC2. This deployment strategy helps teams to first test an app while routing traffic to a non-prod route, when confirmed that the app functions as expected, then the traffic is routed to prod. In case of any failure, a rollback is initiated for the previously working version hence avoiding downtime.
The Infrastructure consists of an Application Load Balancer which exposes the app on Port 80, routes traffic to the autoscaling group managed by ECS, a fleet of EC2 instances running in two AZs for High availability. Each of these instances have ECS agent installed and the necessary software for running our Docker containers. These interact with Aurora PostgreSQL database in RDS for data storage. Aurora PostgreSQL database is configured to replicate data in another availability zone for a resilient database configuration. When there is a spike in traffic, ECS will launch other containers in order to accommodate the load.
Provided the developers do changes and want to update the deployed app, our CI/CD pipeline is configured to automate the deployment. With code stored in GitLab, once there is a push, AWS CodePipeline is triggered via a connection app setup and authenticated to Gitlab, Codebuild builds, containerize and push the image to ECR, next Codedeploy deploys the new app, first will deploy it with port 8080 for tests, if the team is happy with their changes, they can approve for traffic to be switch to the newly deployed container and terminate the former. The former containers can be configured to still run for some time while the newly deployed is tested, if everything is fine, then the last version of the deployed app can be terminated.
**Note**: _If you face issues putting it up and working, go to the optional stage and deploy with Cloudformation_
Ensure you have a code editor like VScode, you have a Gitlab account, an AWS account will appropriate permissions(full access to RDS, ECS, ECR, IAM), configure awscli on you terminal with access keys
On your local computer terminal(i use wsl with ubuntu os) run
git clone https://gitlab.com/ndzenyuy/tripmgmt.git
cd tripmgmt
rm -rf .git
git init
code .
It will clone the repository that has the application code to your local machine, enter the folder and remove the .git file so as to remove the url for the repository from whence the code was pulled, therefore making it possible to use the code and push to your own repository.
On the browser, go to GitLab and create an account if you don't have one, in it, create a repository named "tripmgmt", you can make the project public and don't create it with a READme.md file. Now copy the repository http url and go back to your terminal and run the following:
git remote add origin <your repo url>
git add .
git commit -m "Initial commit"
git push --set-upstream origin main
These will push the code to the newly created repository.
To create the ecsTaskExecutionRole IAM role
To create the ecsInstanceRole IAM role
To create the ecsCodeDeployRole IAM role
In this section, we will setup Aurora PostgreSQL RDS with Multi-AZ configuration.
We will create an Amazon EC2 application load balancer. This will be the public endpoint to access Trip Management Monolith Application. The load balancer must use a VPC with two public subnets in different Availability Zones.
First create Target groups for your load balancer
To create an Amazon EC2 application load balancer
Amazon ECS creates an Amazon EC2 Auto Scaling launch template and Auto Scaling group on your behalf as part of the AWS CloudFormation stack.
Select Create new group, and then provide the following details about the group:
For Capacity, enter 2 for the minimum number and 4 for the maximum number of instances to launch in the Auto Scaling group.
Under Network settings for Amazon EC2 instances, choose default VPC and same two subnets, which were selected at that time of creating Application Load Balancer in previous section.
Choose Create
Create Security Group for EC2 Container Instance
First create Amazon CloudWatch Log Group, where taskdef is configured to send all logs.
In order to create an ECS Task, we will need to create a ECS Task Definition file. Go to you cli, make sure it is pointing to the folder tripmgmt and delete the file taskdef.json by running the command
rm taskdef.json
export LOG_GROUP=tripmgmt-demo-ecstask-loggrp
export DB_USERNAME=postgres
export DB_PASSWORD=SuperSecretPGSqlPwd##2006
export AWS_DEFAULT_REGION=<<AWS-REGION>>
export TASK_EXECUTION_ROLE_ARN="arn:aws:iam::<<AccountID>>:role/ecsTaskExecutionRole"
export AURORA_PGSQL_RDS_URL="tripmgmtdb-cluster.cluster-<<UNIQUEID>>.<<AWS-REGION>>.rds.amazonaws.com"
export ECR_LATEST_IMAGE_URL="<<AccountID>>.dkr.ecr.<<AWS-REGION>>.amazonaws.com/devops/tripmgmtdemo:latest"
LOG_GROUP : Verify name as you have created in Step No 1 in this section, only change if you have used different log group name.DB_USERNAME: Database username set while creating Aurora PostgreSQL DB Cluster.DB_PASSWORD: Database password set while creating Aurora PostgreSQL DB Cluster.TASK_EXECUTION_ROLE_ARN: Task Execution Role created in Create IAM Roles section.AURORA_PGSQL_RDS_URL: Aurora PostgreSQL RDS Cluster URL as created in Create Aurora PostgreSQL DB section.ECR_LATEST_IMAGE_URL: Elastic Container Registry Image URL from Create Container Repository section.envsubst < "taskdef_src.json" > "taskdef.json"
aws ecs register-task-definition --cli-input-json file://taskdef.json
Please save the value of the TaskDefinition ARN from output in the open text file to use in the later section of the workshop. It is at the very top of the output and should look something like arn:aws:ecs:<>:<>:task-definition/task-tripmgmt:1.
Commit taskdef.json in repository.
git add taskdef.json
git commit -m "Updated Taskdef"
Prepare AppSpec File
AWS CodeDeploy requires AppSpec YAML-formatted file to manage deployment. In the project folder on the terminal, run the code below and edit the value of the taskdefinition arn to reflect what you had in step 4 above(similar to: arn:aws:ecs:<>:<>:task-definition/task-tripmgmt:1.)
nano appspec.yaml
git add appspec.yaml
git commit -m "appspec file with Taskdef url"
git push
On specify Stack details
Stack name: tripmgmt
KeyPairName: <select a keypair in you account or create on if absent>
PublicSubnet1Id: <select a public subnet>
PublicSubnet2Id: <select a public subnet>
VpcId: <select the default vpc id>
click next
Scroll down and acknowledge,
and click next scroll and click submit
This will create the infrastructure needed to run our Pipeline.
The Engineering team commit changes to code base and then push those changes to a git repository. It triggers AWS CodePipeline action. AWS CodeBuild will compile source code and build & store container image in an Elastic Container Registry. AWS CodeDeploy will initiate Blue/Green deployment of ECS Task(s) in an ECS Cluster through ECS Service.
To setup AWS CodeBuild, first we need to create/modify buildspec.yml file to describe build steps. After that, we need to configure the CodeBuild Project linking with the GitLab Repository.
On the cli, run the code below and edit the values of the following parameters to suite those you have:
AWS_ACCOUNT_IDAWS_DEFAULT_REGIONREPOSITORY_URI
nano buildspec.yml
After editing, run ctrl + x, when prompted to save changes press Y then press enter to confirm.
Setup CodeBuild Project
Now edit newly created service role codebuild-tripmgmt-demo-build-service-role to allow accessing ECR repository through AmazonEC2ContainerRegistryPowerUser managed policy.
Select the build project and Start build to test GitLab and CodeBuild integration.
Post successful build, you can verify new docker image in Amazon ECR console.
As per the architectural diagram, Engineering team commit changes to code base and then push those changes to a Git repository. It triggers AWS CodePipeline action, AWS CodeBuild will compile source code and build & store container image in an Elastic Container Registry. AWS CodeDeploy will initiate Blue/Green deployment of ECS Task(s) in an ECS Cluster through ECS Service. Upon successful deployment of ECS Task(s), users can access Web Portal through DNS URL pointing to ALB endpoint. ALB endpoint serves client requests from ECS Cluster after automatically adjusting capacity to maintain steady state.
Create CodeDeploy Application
To create a CodeDeploy application
To create a CodeDeploy deployment group
Under Deployment settings,
Choose Create deployment group.
In this section, we will create a DevOps pipeline with the following actions:
Review the information, and then choose Create pipeline. Immediately, stop the Pipeline Execution with Stop and Abandon pop-up action.
Modify Deploy Stage
On the browser where you pasted the DNS of the load balancer, check the app that is deployed, it should still be the one without the changes
After the deployment is complete, before traffic is rerouted, check the browser with the 8080 port, you should see the web page with the changes:
Code deploy still deploying the new container on ECS, traffic is still flowing to the initial deployment. Once the deployment stage is complete, it will forward test traffic to the same alb link but on a different port:8080
The pipeline will wait 5 minutes for the newly deployed app to be tested(as configured in code pipeline). Once the time elapses, the pipeline will automatically route traffic
After tests, the engineer can now reroute traffic by clicking on reroute traffic, after they are sure their changes are as expected:
The traffic will instantly be rerouted to the new tasks, and will keep the former tasks should incase there is need for rollback after live traffic is routed to it, now both links for test and prod will display the same app, while waiting for a termination of the former: 
During the deployment phase, out of expected 2 task, ECS runs 4 tasks, this will ensure that the newly deployed app is stable before the termination of these can be authorized.
On the console, go to Cloudformation stacks and delete tripmgmt stack, or if you created the resources on the console, then delete them in the order they were created. Go to Developer tools and delete the pipeline, in codebuild, delete the build job.
2025-11-22 05:34:52
The dev ecosystem is shifting fast.
Engineers who combine design intuition, multi-stack skills, and AI-driven workflows are leading the next wave of digital innovation.
This blend is helping teams ship better products with fewer bottlenecks - and developers who embrace it are becoming the new industry leaders.
2025-11-22 05:30:41
You loved Nano-Banana? Created figurine images of all your friends and ghost face behind all your foes? Here now comes the not-so-nano "Gemini 3 Pro Image" model, that you will all prefer calling Nano Banana Pro!
While the Flash model (Nano Banana) brought speed and affordability, the Pro version introduces "thinking" capabilities, search grounding, and high-fidelity 4K output. It's time to go bananas with complex creative tasks!
This guide will walk you through the advanced features of Nano Banana Pro using the Gemini Developer API.
This guide will cover:
Note: for an interactive version of this post, checkout the python cookbook or the AI Studio's Javascript Notebook.
While end-users can access Nano Banana Pro in the Gemini app, the best environment for developers to prototype and test prompts is Google AI Studio. AI Studio is a playground to experiment with all available AI models before writing any code, and it's also the entry point for building with the Gemini API.
You can use Nano Banana Pro within AI Studio. To get started, go to aistudio.google.com, sign in with your Google account, and select Nano Banana Pro (Gemini 3 Pro Image) from the model picker.
Contrary to Nano-Banana, the pro version doesn't have a free tier, which means you need to select an API key with billing enabled (see "project setup" section below).
Tip: You can also vibe code Nano Banana web apps directly in AI Studio at ai.studio/apps, or explore the code and remix one of the existing apps.
To follow this guide, you will need the following:
If you already are a hardcore Gemini API user with all of that, great! just skip this section and move to the next one. Otherwise, here's how to get started:
When you first log in on AI Studio, a Google Cloud project and an API key should be automatically created.
Open the API key management screen and click on the "copy" icon to copy your API key.
Since Nano Banana Pro doesn't have a free tier. You must enable billing on your Google Cloud project.
In the API key management screen, click Set up billing next to your project and follow the on-screen instructions.
Image generation with Nano Banana Pro is more expensive than the Flash version, especially for 4K images. At the time this post is published, a 1K or 2K image costs $0.134, while a 4K one costs $0.24 (plus the token cost of the input and the text output).
Check the pricing in the documentation for the latest details.
Choose the SDK for your preferred language.
Python:
pip install -U google-genai
# Install the Pillow library for image manipulation
pip install Pillow
JavaScript / TypeScript:
npm install @google/genai
The following examples use the Python SDK for demonstration. Equivalent code snippets to use Nano Banana in JavaScript are provided in this JS Notebook.
To use the Pro model, you'll need to use the gemini-3-pro-image-preview model ID.
from google import genai
from google.genai import types
# Initialize the client
client = genai.Client(api_key="YOUR_API_KEY")
# Set the model ID
PRO_MODEL_ID = "gemini-3-pro-image-preview"
Before we get into the fancy stuff, let's look at a standard generation. You can control the output using response_modalities (to get text and images or only images) and aspect_ratio.
prompt = "Create a photorealistic image of a siamese cat with a green left eye and a blue right one"
aspect_ratio = "16:9" # "1:1","2:3","3:2","3:4","4:3","4:5","5:4","9:16","16:9" or "21:9"
response = client.models.generate_content(
model=PRO_MODEL_ID,
contents=prompt,
config=types.GenerateContentConfig(
response_modalities=['Text', 'Image'], # Or just ['Image']
image_config=types.ImageConfig(
aspect_ratio=aspect_ratio,
)
)
)
# Display the image
for part in response.parts:
if image:= part.as_image():
image.save("cat.png")
Chat mode is also an option (it's actually what I would recommend for multi-turn editing). Check the 8th example, "Polyglot Banana", for an example.
Nano Banana Pro isn't just drawing; it's thinking. This means it can reason through your most complex, twisted prompts before generating an image. And the best part? You can peek into its brain!
To enable this, set include_thoughts=True in the thinking_config.
prompt = "Create an unusual but realistic image that might go viral"
aspect_ratio = "16:9"
response = client.models.generate_content(
model=PRO_MODEL_ID,
contents=prompt,
config=types.GenerateContentConfig(
response_modalities=['Text', 'Image'],
image_config=types.ImageConfig(
aspect_ratio=aspect_ratio,
),
thinking_config=types.ThinkingConfig(
include_thoughts=True # Enable thoughts
)
)
)
# Display the image and thoughts
for part in response.parts:
if part.thought:
print(f"Thought: {part.text}")
elif image:= part.as_image():
image.save("viral.png")
This transparency helps you understand how the model interpreted your request. It's like having a conversation with your artist!
One of the most game-changing features is Search Grounding. Nano Banana Pro isn't stuck in the past; it can access real-time data from Google Search to generate accurate, up-to-date images. Want the weather? You got it.
For example, you can ask it to visualize the current weather forecast:
prompt = "Visualize the current weather forecast for the next 5 days in Tokyo as a clean, modern weather chart. add a visual on what i should wear each day"
response = client.models.generate_content(
model=PRO_MODEL_ID,
contents=prompt,
config=types.GenerateContentConfig(
response_modalities=['Text', 'Image'],
image_config=types.ImageConfig(
aspect_ratio="16:9",
),
tools=[{"google_search": {}}] # Enable Google Search
)
)
# Save the image
for part in response.parts:
if image:= part.as_image():
image.save("weather.png")
# Display sources (you must always do that)
print(response.candidates[0].grounding_metadata.search_entry_point.rendered_content)
Need print-quality images? Nano Banana Pro supports 4K resolution. Because sometimes, bigger is better.
prompt = "A photo of an oak tree experiencing every season"
resolution = "4K" # Options: "1K", "2K", "4K", be careful lower case do not work.
response = client.models.generate_content(
model=PRO_MODEL_ID,
contents=prompt,
config=types.GenerateContentConfig(
response_modalities=['Text', 'Image'],
image_config=types.ImageConfig(
aspect_ratio="1:1",
image_size=resolution
)
)
)
Note: 4K generation comes at a higher cost, so use it wisely!
The model can generate and even translate text within images across over a dozen languages. It's basically a universal translator for your eyes.
# Generate an infographic in Spanish
message = "Make an infographic explaining Einstein's theory of General Relativity suitable for a 6th grader in Spanish"
response = chat.send_message(message,
config=types.GenerateContentConfig(
image_config=types.ImageConfig(aspect_ratio="16:9")
)
)
# Save the image
for part in response.parts:
if image:= part.as_image():
image.save("relativity.png")
# Translate it to Japanese
message = "Translate this infographic in Japanese, keeping everything else the same"
response = chat.send_message(message)
# Save the image
for part in response.parts:
if image:= part.as_image():
image.save("relativity_JP.png")
While the Flash model can mix up to 3 images, the Pro model can handle up to 14 images! That's a whole party in one prompt. Perfect for creating complex collages or showing off your entire product line.
# Mix multiple images
response = client.models.generate_content(
model=PRO_MODEL_ID,
contents=[
"An office group photo of these people, they are making funny faces.",
PIL.Image.open('John.png'),
PIL.Image.open('Jane.png'),
# ... add up to 14 images
],
)
# Save the image
for part in response.parts:
if image:= part.as_image():
image.save("group_picture.png")
Note: If you want very high fidelity for your characters, limit yourself to 5, which is already more than enough for a party night!
Here are some examples of what's possible only with Nano Banana Pro. Prepare to be amazed:
Prompt: "Search the web then generate an image of isometric perspective, detailed pixel art that shows the career of Guillaume Vernade"
This uses search grounding to find specific information about a person and visualizes it in a specific style.
Prompt: "Show me an infographic about how sonnets work, using a sonnet about bananas written in it, along with a lengthy literary analysis of the poem. Good vintage aesthetics"
The model can generate coherent, lengthy text and integrate it perfectly into a complex layout.
Prompt: "A photo of a program for the Broadway show about TCG players on a nice theater seat, it's professional and well made, glossy, we can see the cover and a page showing a photo of the stage."
Create photorealistic mockups of print materials with accurate lighting and texture.
To achieve the best results with the Nano Banana models, follow these prompting guidelines:
Be Hyper-Specific: The more detail you provide about subjects, colors, lighting, and composition, the more control you have over the output.
Provide Context and Intent: Explain the purpose or desired mood of the image. The model's understanding of context will influence its creative choices.
Iterate and Refine: Don't expect perfection on the first try. Use the model's conversational ability to make incremental changes and refine your image.
Use Step-by-Step Instructions: For complex scenes, break your prompt into a series of clear, sequential instructions.
Use Positive Framing: Instead of negative prompts like "no cars," describe the desired scene positively: "an empty, deserted street with no signs of traffic."
Control the Camera: Use photographic and cinematic terms to direct the composition, such as "wide-angle shot", "macro shot", or "low-angle perspective".
Use search grounding to your advantage: When you know that you want the model to use real-time or real-world data, be very precise about it. "Search the web about the last Olympic Lyonnais's game and make an infographics" will work better than just "an infographics of the OL last games" (which should still work, but don't take chances).
For a deeper dive into best practices, check the prompting guide in the documentation and the prompting best practices for Nano Banana publish on the official blog.
Nano Banana Pro (Gemini 3 Pro Image) opens up a new frontier for AI image generation. With its ability to think, search, and render in 4K, it's a tool for serious creators (and serious fun).
Ready to try it out? Head over to Google AI Studio, try or customize our Apps or check out the cookbook.