Sunday, August 30, 2026

What are the major vLLM configuration parameters for tuning

* **`MAX_MODEL_LEN="32767"`**: Sets the maximum token context window (prompts plus generated answers) the engine will handle. Restricting this to 32,767 tokens instead of the native ultra-large context (like 256K) drastically reduces the GPU memory required by the KV cache, allowing for higher concurrency and faster boot times.

* **`QUANTIZATION_TYPE="fp8"`**: Specifies 8-bit floating-point (FP8) precision for the model weights. This compresses the size of the model down significantly, cutting memory usage roughly in half and accelerating inference speed with minimal loss in model intelligence.

* **`KV_CACHE_DTYPE="fp8"`**: Compresses the Key-Value (KV) cache storage into FP8 format instead of standard FP16/BF16. Because the KV cache grows rapidly with long conversations, this halves its memory footprint, freeing up space to hold more concurrent users and longer contexts.

* **`GPU_MEM_UTIL="0.95"`**: Tells vLLM to claim and lock down **95%** of the total available GPU VRAM on your Cloud Run instance. The remaining 5% is left as breathing room for PyTorch operations and context switching to prevent out-of-memory (OOM) crashes.

* **`TENSOR_PARALLEL_SIZE="1"`**: Determines how many GPUs the model is split across. Set to `1` because your Cloud Run service instance is provisioned with a single GPU, meaning the entire model runs on that single card.

* **`MAX_NUM_SEQS="16"`**: Caps the maximum number of simultaneous sequences (requests) vLLM will batch and process together in a single step [cite: . This prevents memory spikes under heavy web traffic by queuing excess incoming chat requests.



My Cloud Run hangs while downloading Large OpenWeight model Is it normal?

The output is like below 

ravi_retheesh@cloudshell:~ (gemmabigquerymcp)$ gcloud builds submit --project="${GOOGLE_CLOUD_PROJECT}" --region="${GOOGLE_CLOUD_REGION}" --no-source \

substitutions="_MODEL_NAME=${MODEL_NAME},_GCS_MODEL_LOCATION=${GCS_MODEL_LOCATION}" \


    --config=/dev/stdin <<'EOF'


steps:


- name: 'gcr.io/google.com/cloudsdktool/google-cloud-cli:slim'


  entrypoint: 'bash'


  args:


  - '-c'


  - |


    if [[ "$_GCS_MODEL_LOCATION" == *"vertex-model-garden-public-us"* ]]; then


      echo "Using the public cache bucket."


      exit 0


    fi


    gcloud config set storage/parallel_composite_upload_enabled True


    gcloud config set storage/parallel_composite_upload_threshold 150M


    gcloud config set storage/sliced_object_download_threshold 150M


    MODEL_NAME="$_MODEL_NAME"


    SHORT_NAME="$${MODEL_NAME#*/}"


    gcloud storage cp -r -D "gs://vertex-model-garden-public-us/gemma4/$${SHORT_NAME}" "$_GCS_MODEL_LOCATION"


EOF


Created [https://cloudbuild.googleapis.com/v1/projects/gemmabigquerymcp/locations/us-central1/builds/21faa182-824e-42fb-b292-d4368222d847].


Logs are available at [ https://console.cloud.google.com/cloud-build/builds;region=us-central1/21faa182-824e-42fb-b292-d4368222d847?project=593821728960 ].


Waiting for build to complete. Polling interval: 1 second(s).


----------------------------- REMOTE BUILD OUTPUT ------------------------------


starting build "21faa182-824e-42fb-b292-d4368222d847"




FETCHSOURCE


BUILD


Pulling image: gcr.io/google.com/cloudsdktool/google-cloud-cli:slim


slim: Pulling from google.com/cloudsdktool/google-cloud-cli


6310eb16bf42: Pulling fs layer


488f94d8fb5f: Pulling fs layer


4f4fb700ef54: Pulling fs layer


3cbf6ceea8d8: Pulling fs layer


8421ab9bea9a: Pulling fs layer


488f94d8fb5f: Verifying Checksum


488f94d8fb5f: Download complete


8421ab9bea9a: Verifying Checksum


8421ab9bea9a: Download complete


4f4fb700ef54: Verifying Checksum


4f4fb700ef54: Download complete


6310eb16bf42: Verifying Checksum


6310eb16bf42: Download complete


6310eb16bf42: Pull complete


488f94d8fb5f: Pull complete


4f4fb700ef54: Pull complete


3cbf6ceea8d8: Verifying Checksum


3cbf6ceea8d8: Download complete


3cbf6ceea8d8: Pull complete


8421ab9bea9a: Pull complete


Digest: sha256:14026c08cf391812086012d6c5f14078221ce1b46be0df419f7f31ec9f69c712


Status: Downloaded newer image for gcr.io/google.com/cloudsdktool/google-cloud-cli:slim


gcr.io/google.com/cloudsdktool/google-cloud-cli:slim


Updated property [storage/parallel_composite_upload_enabled].


Updated property [storage/parallel_composite_upload_threshold].


Updated property [storage/sliced_object_download_threshold].


Copying gs://vertex-model-garden-public-us/gemma4/gemma-4-31B-it/README.md to gs://gemmabigquerymcp-us-central1-hf-model-cache/model-cache/google/gemma-4-31B-it/README.md


Copying gs://vertex-model-garden-public-us/gemma4/gemma-4-31B-it/chat_template.jinja to gs://gemmabigquerymcp-us-central1-hf-model-cache/model-cache/google/gemma-4-31B-it/chat_template.jinja


  


Copying gs://vertex-model-garden-public-us/gemma4/gemma-4-31B-it/config.json to gs://gemmabigquerymcp-us-central1-hf-model-cache/model-cache/google/gemma-4-31B-it/config.json


Copying gs://vertex-model-garden-public-us/gemma4/gemma-4-31B-it/generation_config.json to gs://gemmabigquerymcp-us-central1-hf-model-cache/model-cache/google/gemma-4-31B-it/generation_config.json


Copying gs://vertex-model-garden-public-us/gemma4/gemma-4-31B-it/model-00001-of-00002.safetensors to gs://gemmabigquerymcp-us-central1-hf-model-cache/model-cache/google/gemma-4-31B-it/model-00001-of-00002.safetensors


Copying gs://vertex-model-garden-public-us/gemma4/gemma-4-31B-it/model-00002-of-00002.safetensors to gs://gemmabigquerymcp-us-central1-hf-model-cache/model-cache/google/gemma-4-31B-it/model-00002-of-00002.safetensors


Copying gs://vertex-model-garden-public-us/gemma4/gemma-4-31B-it/model.safetensors.index.json to gs://gemmabigquerymcp-us-central1-hf-model-cache/model-cache/google/gemma-4-31B-it/model.safetensors.index.json


Copying gs://vertex-model-garden-public-us/gemma4/gemma-4-31B-it/processor_config.json to gs://gemmabigquerymcp-us-central1-hf-model-cache/model-cache/google/gemma-4-31B-it/processor_config.json


Copying gs://vertex-model-garden-public-us/gemma4/gemma-4-31B-it/tokenizer.json to gs://gemmabigquerymcp-us-central1-hf-model-cache/model-cache/google/gemma-4-31B-it/tokenizer.json


Copying gs://vertex-model-garden-public-us/gemma4/gemma-4-31B-it/tokenizer_config.json to gs://gemmabigquerymcp-us-central1-hf-model-cache/model-cache/google/gemma-4-31B-it/tokenizer_config.json 







Yes, hanging at this point is completely expected.


What you are looking at in your terminal output is the script successfully copying the smaller configuration files (README.md, tokenizers, json configs), and it has now reached the heavy .safetensors files.


What is happening internally?

Massive File Sizes: The Gemma 4 31B model consists of multi-gigabyte weight tensors split across multiple large files (e.g., model-00001-of-00002.safetensors and model-00002-of-00002.safetensors), each weighing anywhere from 10 GB to 15 GB+ depending on the quantization.


Silent Progress: The standard gcloud storage cp command does not stream a granular, incremental progress bar inside a Cloud Build remote execution log. Because it is processing a massive file payload over the network in total silence, the terminal appears completely frozen.


Is it actually working?

Yes. As long as the build hasn't timed out or thrown an explicit error, the Cloud Build worker is actively pulling the file blocks from Google's public model garden bucket and streaming them into your custom GCS cache bucket (gemmabigquerymcp-us-central1-hf-model-cache).


What should you do?

Wait it out: Depending on network routing inside the us-central1 data center, a multi-gigabyte copy can take anywhere from 2 to 10 minutes.


Verify via Console (Optional): If you want to check if data is actually transferring, you can open a separate Cloud Shell tab and run a check on your destination bucket to see file sizes growing:


Bash

gcloud storage du -s "gs://${MODEL_CACHE_BUCKET}"

Let it run for a few more minutes; it will finish and proceed to the next step once the tensor files are fully copied over.


How to run Large OpenWeight models on Infra like cloud run?

**Yes, this snippet is very good and standard practice** for handling large open-weights models like Gemma 4 on serverless infrastructure like Cloud Run.


### How This Works and Why It's Designed This Way


* **Bypassing Cloud Build Limits:** Cloud Build has strict storage limits and timeouts. Trying to download a massive 30GB+ model inside a standard build step or pushing it straight into a container image will typically break or exceed size thresholds.

* **Leveraging Google's Public Cache (`vertex-model-garden-public-us`):** Google hosts public copies of model weights inside specialized regional GCS buckets. If your Cloud Run service runs in a `us-` region, the snippet intelligently skips downloading entirely (`exit 0`), allowing your app to stream weights straight from Google’s ultra-fast internal network.

* **Parallel Upload Optimization:** If you are using a non-US region or deploying a custom fine-tuned variant, the `gcloud config set storage/...` commands configure parallel composite uploads and sliced downloads. This breaks large model safetensors files into chunks, downloading them concurrently to bypass single-stream bottlenecks.


---


### Your Options to Run Gemma 4 on Google Cloud Run


When deploying Gemma 4 (such as the 31B Dense or 26B MoE variants) to Cloud Run, you have two primary deployment architectures:


| Approach | Architecture | Best For |

| --- | --- | --- |

| **1. vLLM Container + GCS Cache (The Snippet Method)** | Packages vLLM inside a custom container image, pulls weights directly from GCS into GPU memory using high-performance streaming. | High throughput, production-grade OpenAI-compatible API serving, and maximum token generation speed. |

| **2. Ollama on Cloud Run** | Deploys an Ollama runtime container to Cloud Run backed by serverless GPUs, pulling model weights dynamically on start. | Lightweight setups, rapid prototyping, and simpler configuration files. |


Both approaches require provisioning **NVIDIA RTX Pro 6000 (Blackwell)** or similar serverless GPUs on Cloud Run to supply enough VRAM to hold the model weights.

Do Google Provide vLLM service? How do cache the model weights?


 This command creates a dedicated Google Cloud Storage (GCS) bucket to act as a staging cache for your large AI model weights.



Why is this step performed?

Bypassing Hugging Face Rate Limits / Slowdowns: Downloading massive multi-gigabyte open-weights models directly from Hugging Face every time a Cloud Run container spins up is slow and prone to network timeouts or rate limits.


Optimizing Cold Starts with vLLM: When combined with the Run:ai Model Streamer feature built into vLLM, the container can stream model weight tensors concurrently and directly from GCS into GPU memory.

 This drastically minimizes container boot-up and model-loading times.


Direct VPC Egress: Keeping the bucket in the same single region as your Cloud Run service ensures data flows privately and rapidly over Google's internal network rather than traversing the public internet.


Does Google by default provide a vLLM runtime?

No, Google Cloud does not provide a pre-installed, managed vLLM runtime service out of the box (like a native managed-vllm API endpoint).


Instead, Google provides the underlying infrastructure to run vLLM yourself:


Compute Support: Cloud Run supports attaching high-performance GPUs (such as NVIDIA L4 or RTX Pro 6000) and Google Cloud TPUs, alongside serverless scaling.


Bring-Your-Own-Container (BYOC): To use vLLM on Cloud Run, you package vLLM inside a custom container image (or use open-source deep learning containers/Buildpacks) that pulls the model weights from your GCS bucket upon startup and exposes an OpenAI-compatible API endpoint.

Friday, August 28, 2026

What is PodMonitoring and node-exporter in Kubernetes?

A PodMonitoring is a custom Kubernetes resource used by Google Cloud Managed Service for Prometheus to define how metric data from application pods is scraped and ingested.What It DoesTarget Scraping: Finds specific pods within a Kubernetes namespace using label selectors and scrapes their Prometheus-formatted metrics endpoints.Flow Control: Controls how metrics stream into Cloud Monitoring, allowing you to modify scrape intervals, apply time-series filtering, reduce data rates, and use Prometheus relabeling rules.Namespace Scoping: Scrapes targets strictly within the single namespace where the resource is deployed (you must deploy copies across multiple namespaces to scrape globally, or use a ClusterPodMonitoring resource instead)



Node Exporter acts as the data producer, while a monitoring custom resource acts as the data collector.When you want to monitor hardware and OS metrics (like CPU, memory, and disk usage) of your Google Kubernetes Engine (GKE) nodes, you deploy Node Exporter. To actually pull those metrics into Google Cloud, you use a target-scraping custom resource.Because Node Exporter tracks node-level infrastructure rather than isolated application workflows, it connects to Google Cloud Managed Service for Prometheus using two main strategies:1. The Global Connection (ClusterPodMonitoring)While you can use a standard PodMonitoring resource, Google Cloud recommends using a ClusterPodMonitoring resource for Node Exporter.The Problem: Node Exporter runs as a DaemonSet across all nodes, usually isolated in a system namespace (like kube-system or gmp-system). A standard PodMonitoring resource is strictly limited to looking inside its own namespace.The Connection: A ClusterPodMonitoring resource breaks past namespace boundaries. It identifies all Node Exporter pods running across your entire cluster using label selectors (e.g., app.kubernetes.io/name: node-exporter) and scrapes their metric endpoints (typically port 9100).2. The Isolated Connection (PodMonitoring)If you specifically choose to use a standard PodMonitoring resource instead, you must deploy it directly into the exact same namespace where your Node Exporter daemonset lives. It will selectively connect to and scrape only the Node Exporter pods within that specific namespace boundary.What the Configuration Looks LikeTo bridge the gap between Node Exporter and Google Cloud, you apply a manifest that explicitly targets the exporter. Here is the official setup pattern for the Google Cloud Node Exporter integration using a cluster-wide monitoring rule:yamlapiVersion: monitoring.gke.io/v1

kind: ClusterPodMonitoring

metadata:

  name: node-exporter

spec:

  selector:

    matchLabels:

      app.kubernetes.io/name: node-exporter # 1. Finds the Node Exporter pods

  endpoints:

  - port: metrics                         # 2. Targets the exporter's metric port

    interval: 30s                         # 3. Sets how frequently to scrape hardware data

Use code with caution.The Data Pipeline FlowNode Exporter gathers raw kernel, memory, and disk utilization data directly from the host GKE node.Google Cloud's Managed Collector reads your monitoring configuration, discovers the exporter pods via the labels, and scrapes the data.The metrics are forwarded to Google's Monarch database, allowing you to view node health using PromQL in Cloud Monitoring or Grafana.Are you setting up Node Exporter to build a custom cluster dashboard, or are you troubleshooting missing node-level metrics in Cloud Monitoring?


Google Cloud Collect metrics from Exporters using the Managed Service for Prometheus

Main aim is to 

Deploy a GKE instance

Configure the PodMonitoring custom resource and node-exporter tool

Build the GMP binary locally and deploy to the GKE instance

Apply a Prometheus configuration to begin collecting metrics

gcloud auth list

To ingest the metric data emitted by the example application, you use target scraping. Target scraping and metrics ingestion are configured using Kubernetes custom resources. The managed service uses PodMonitoring custom resources (CRs).

A PodMonitoring CR scrapes targets only in the namespace the CR is deployed in. To scrape targets in multiple namespaces, deploy the same PodMonitoring CR in each namespace. You can verify the PodMonitoring resource is installed in the intended namespace by running kubectl get podmonitoring -A.

Google Managed Service for Prometheus (GMP) ingestion of Node Exporter metrics links standard open-source infrastructure monitoring with Google Cloud's fully managed global monitoring backend

Node Exporter: A lightweight agent that runs on your servers or cluster nodes to collect low-level, machine-level hardware and operating system metrics (such as CPU usage, memory, disk I/O, and network traffic). It exposes these metrics locally in a standard Prometheus text format.GMP Binary / Collector: Google's drop-in replacement or forked version of the Prometheus collector/binary. Instead of relying on a locally managed Prometheus time-series database for long-term storage, this specialized binary scrapes the local /metrics endpoint of Node Exporter and forwards (pushes) those metrics directly into Google Cloud's global monitoring database (Monarch / Cloud Monitoring).Viewing the Metrics: Querying the gathered data using standard PromQL inside the Google Cloud Console, Metrics Explorer, or connected dashboards like Grafana







Thursday, August 27, 2026

What is Signoz

 




SigNoz is an open-source observability platform built on OpenTelemetry. We’re building an enterprise-grade alternative to fragmented monitoring stacks, with logs, metrics, traces, alerts, and dashboards in one place.


Choose how to run SigNoz

SigNoz Cloud (Recommended)

Fully managed SigNoz with a 30-day free trial, no credit card required, usage-based pricing that starts at $49, and regional data hosting.


Start free →


Enterprise

Enterprise Cloud, BYOC, or Enterprise Self-Hosted with compliance, support, custom retention, RBAC, ingestion controls, data residency, and region selection.


Explore Enterprise →


Community

Free open-source SigNoz that runs in your own infrastructure. Deploy with Docker, Kubernetes, or Linux and keep full control of your data plane.


Install SigNoz →


What can you monitor?

SigNoz helps teams debug production issues faster by connecting logs, metrics, traces, alerts, dashboards, exceptions, and agent-native workflows in one place.


APM Overview

Monitor service latency, error rate, throughput, Apdex, top endpoints, database calls, and external calls.



Log Management

Ingest, search, aggregate, and correlate logs with traces and metrics using a visual query builder.



Metrics and Dashboards

Build dashboards for application, infrastructure, and custom metrics using Query Builder, PromQL, or ClickHouse SQL.



nfrastructure Monitoring

Monitor Kubernetes clusters, pods, nodes, workloads, and host-level CPU, memory, disk, network, logs, and traces.



LLM and AI Observability

Trace LLM apps, RAG pipelines, prompts, tool calls, tokens, latency, and costs alongside application and infrastructure telemetry.


Agent-Native Observability and MCP

Use the SigNoz MCP server to bring telemetry into coding agents, or use Noz inside SigNoz to investigate incidents, tune alerts, and build dashboards with production context. Noz is available only on SigNoz Cloud.


Distributed Tracing

Follow requests across services with flamegraphs, waterfalls, span events, filters, and trace analytics.


Trace Funnels

Create funnels from traces to understand request-flow drop-offs, failed transitions, and systemic workflow issues.


Learn more: Trace funnels documentation


Also monitor: exceptions, alerts, external APIs, and integrations for OpenTelemetry, Prometheus, Kubernetes, cloud providers, language SDKs, application frameworks, databases, and LLM tools.


Why teams use SigNoz

OpenTelemetry-native

Instrument once with open standards and keep ownership of your telemetry.

Correlated signals

Move from service charts to traces, logs, infra metrics, and exceptions without switching tools.

Single columnar database

Built for high-cardinality, high-volume observability workloads.

Predictable pricing

No per-host pricing, no user-seat pricing, and no special pricing for custom metrics.

Enterprise ready

SOC 2 Type II and HIPAA compliance, RBAC, ingestion controls, custom retention, support, BYOC, and self-hosting.



Getting started

Start on Cloud

Create a managed SigNoz workspace and get your first dashboard without running observability infrastructure.


Start free on SigNoz Cloud


Self-host SigNoz

Run SigNoz in your own infrastructure with Foundry, Docker, Kubernetes, or Linux.


Foundry · Docker · Kubernetes · Linux


Send data

Instrument applications and infrastructure with OpenTelemetry, Prometheus, language SDKs, and integrations.


Instrumentation · Integrations


Comparisons to familiar tools

SigNoz is often adopted by teams moving from a stack of single-purpose tools or commercial platforms with unpredictable pricing.


Prometheus

Good if you just need metrics. SigNoz keeps metrics, logs, traces, dashboards, and alerts together so teams can debug with correlated context.


Jaeger

Jaeger only does distributed tracing. SigNoz adds metrics, logs, trace analytics, dashboards, alerts, exceptions, and trace-to-log workflows.


Elastic

SigNoz uses columnar database for efficient observability analytics and high-cardinality log workloads, with 50% lower resource requirement compared to Elastic during ingestion. Check the detailed study.


Loki

In the linked benchmark, SigNoz indexed all keys in the test setup, while Loki hit max stream errors when more labels were added. Check the detailed study.




What is Continuous Deployment vs Canary vs Blue Green Deployment

Continuous deployment automates code releases to production, while blue-green and canary are release strategies that safely manage how users receive those updates.Continuous DeploymentDefinition: A practice where every code change that passes automated tests is sent directly to production without human approval.Goal: Speed up how fast new features and fixes reach users.Requirement: Needs strong automated testing and quick rollback tools to catch bugs fast.


Blue-Green DeploymentsDefinition: A strategy that uses two identical production environments, usually called Blue (current live version) and Green (new version).How it works: You test the new code in the green environment, then switch all user traffic from blue to green at the same time using a load balancer.Benefits: Near-zero downtime and instant rollback if something breaks by pointing traffic back to blue.Drawback: Costs more because you must run two full copies of your infrastructure.


Canary DeploymentsDefinition: A strategy that releases the new version to a very small subset of users or servers before launching it to everyone.How it works: You route a small slice of traffic (like 5%) to the new build, watch for errors or performance issues, and gradually increase the percentage until everyone is on the new version.Benefits: Lowers risk by limiting the impact of hidden bugs to a small group and saves money by not needing a fully duplicated second environment.Drawback: More complex to route traffic and track metrics accurately.If you'd like, I can:Explain how to use feature flags with these strategiesGive an example of a CI/CD pipeline setup

Wednesday, August 26, 2026

What is AI Sprawl

AI sprawl is the uncontrolled growth of artificial intelligence tools, models, and autonomous agents across a company without central oversight or governance. It happens when different teams adopt AI quickly to solve local problems, leaving IT and security teams without a clear inventory of what is running.You can read more about how this impacts businesses in the IBM Guide on AI Agent Sprawl.How AI Sprawl AppearsShadow AI: Employees use unapproved external AI apps or browser extensions for daily tasks.Embedded AI: Software vendors turn on AI writing, search, or summary features by default in standard workplace apps.Autonomous Agents: Separate teams launch independent AI agents that make decisions, write data, and connect to other software without shared rules.Why It HappensEasy Access: Building or turning on AI features takes seconds and requires no special IT approval.Default Settings: Many business software tools now include AI features automatically.Speed Over Rules: Teams want fast results, so they adopt tools before companies can write clear AI policies.The Main RisksSecurity Gaps: Unmonitored AI integrations create new entry points for data leaks or unauthorized access.Compliance Violations: Autonomous agents may pull private or sensitive user data into unsecured workflows.Conflicting Results: Different tools give different answers or duplicate work, which actually slows teams down.You can explore detection methods through platforms like Reco Security or identity management solutions from Okta.Would you like to know how to audit AI tools in your workplace or how to build an AI governance policy?

Tuesday, August 25, 2026

What are Playwright test agents, Are they for developing tests or running and analyzing them?

 Playwright test agents are LLM-driven AI components (Planner, Generator, and Healer) used primarily for developing and maintaining tests rather than just running them.What Are Playwright Test Agents?Playwright test agents are specialized artificial intelligence tools integrated into Playwright. They interact directly with real browser sessions and live DOM states to automate the test creation and maintenance lifecycle.The three core agents include:Planner: Explores a running application and builds structured Markdown test plans.Generator: Converts those Markdown plans into executable Playwright test script files.Healer: Diagnoses test failures caused by UI or locator updates and automatically repairs the code.Are They Used for Testing or Developing Tests?They are used for developing and maintaining tests, acting as an intelligent layer that writes and fixes the code executed by Playwright's traditional test runner.If you'd like, I can share:How to install and configure these agents using npx playwright init-agentsBest practices for reviewing agent-generated codeLet me know how you want to proceed!


What is Selenium and Playwright , what are the differences

 Selenium Architecture and History

Architecture: Selenium uses the WebDriver API to interact between web browsers and browser drivers. It operates by translating test cases into JSON and sending them to the browsers, which then execute the commands and send an HTTP response back.

History: Selenium has been in continuous operation and development for 18+ years. As a longstanding open source project, it offers broad support for browsers/languages, a wide range of community resources and an ecosystem of support.

Playwright Architecture and History

Architecture: Playwright uses a WebSocket connection rather than the WebDriver API and HTTP. This stays open for the duration of the test, so everything is sent on one connection. This is one reason why Playwright’s execution speeds tend to be faster.

History: Playwright is fairly new to the automation scene. It is faster than Selenium and has capabilities that Selenium lacks, but it does not yet have as broad a range of support for browsers/languages or community support. It is open source and backed by Microsoft.

Comparing Playwright vs Selenium Features

It’s important to consider your own needs and pain points when choosing your next test automation framework. The table below will help you compare Playwright vs Selenium.


Criteria Playwright Selenium

Browser Support Chromium, Firefox, and WebKit (note: Playwright tests browser projects, not stock browsers) Chrome, Safari, Firefox, Opera, Edge, and IE

Language Support Java, Python, .NET C#, TypeScript and JavaScript. Java, Python, C#, Ruby, Perl, PHP, and JavaScript

Test Runner Frameworks Support Jest/Jasmine, AVA, Mocha, and Vitest Jest/Jasmine, Mocha, WebDriver IO, Protractor, TestNG, JUnit, and NUnit

Operating System Support Windows, Mac OS and Linux Windows, Mac OS, Linux and Solaris

Architecture Headless browser with event-driven architecture 4-layer architecture (Selenium Client Library, JSON Wire Protocol, Browser Drivers and Browsers)

Integration with CI Yes Yes

Prerequisites NodeJS Selenium Bindings (for your language), Browser Drivers and Selenium Standalone Server

Real Device Support Native mobile emulation (and experimental real Android support) Real device clouds and remote servers

Community Support Smaller but growing set of community resources Large, established collection of documentation and support options

Open Source Free and open source, backed by Microsoft Free and open source, backed by large community



What is Fixture in PlayWright . How it is different from Hooks

 




A fixture in Playwright is a piece of environment or data that is prepared in advance for a test to use. It is the core concept behind Playwright's built-in dependency injection system, allowing you to isolate and establish a clean, predictable state for every single test case.Instead of writing repetitive code to open a browser, create a page, or configure headers inside traditional beforeEach and afterEach hooks, you simply ask for what your test needs by passing it as an argument.How Fixtures WorkFixtures encapsulate both the setup and teardown logic within a single function using the await use() statement.Code written before await use() acts as the setup phase.The await use() function hands control over to the test itself (and passes any necessary values).Code written after await use() automatically acts as the cleanup/teardown phase once the test finishes.



Example of a Built-In FixtureWhen you write a standard Playwright test, you are already using fixtures, most notably the { page } fixture:javascriptimport { test, expect } from '@playwright/test';


// { page } is a built-in fixture automatically injected into the test

test('basic test', async ({ page }) => {

  await page.goto('https://playwright.dev/');

  await expect(page).toHaveTitle(/Playwright/);

});



Behind the scenes, Playwright automatically launches the browser, creates a unique browser context (like an incognito window), and passes a new page tab into your test block without you needing to manage the browser lifecycle manually.Primary Built-In FixturesPlaywright offers several pre-configured fixtures out of the box:page: An isolated browser tab instance for the specific test run.context: An isolated browser context (session) that handles unique cookies and storage states.browser: The actual browser instance shared across multiple tests in a single worker process.request: A pre-configured API request context instance to handle backend API testing calls.Why Use Fixtures Over Hooks (beforeEach / afterEach)?The Playwright documentation recommends fixtures over traditional hooks because they provide distinct architectural advantages:🏃 Lazy and On-Demand: Fixtures only execute if a specific test explicitly requests them in its arguments. Traditional hooks run before every test regardless of whether the test needs that setup.🧩 Composable: Fixtures can depend on other fixtures. For instance, a custom authenticatedPage fixture can automatically consume and build upon the built-in page fixture.🔀 Scoped Flexibility: They can be configured as test-scoped (recreated for every test case for absolute isolation) or worker-scoped (created once and shared across multiple parallel tests for expensive tasks like setting up a database connection).🛠️ Customizable: You can easily build custom fixtures using test.extend() to encapsulate Page Object Models (POM), log-in sessions, or global mock states into single, reusable arguments.Would you like to see a practical code example of how to create a custom fixture (like an authenticated session or a Page Object Model fixture), or are you trying to migrate existing beforeEach hooks to a fixture-based setup?

Monday, August 24, 2026

Google Cloud Storage - Creating bucket and related

Cloud Storage allows world-wide storage and retrieval of any amount of data at any time. You can use Cloud Storage for a range of scenarios including serving website content, storing data for archival and disaster recovery, or distributing large data objects to users via direct download.



Create a storage bucket

Upload objects to the bucket

Create folders and subfolders in the bucket

Make objects in a storage bucket publicly accessible

I needed to click on the Google Cloud Shell from the top right of the Google Cloud Console. 


Cloud Shell

Manage your infrastructure and develop your applications from any browser with Cloud Shell.

Cloud Shell comes with Cloud SDK gcloud, Cloud Code, an online Code Editor and other utilities pre-installed, fully authenticated and up-to-date. Learn more.

 Cloud Shell is free for all users.

 Gemini Code Assist is enabled in Cloud Shell Editor by default for all users.


Authorize Cloud Shell

Cloud Shell needs permission to use your credentials to make Google Cloud API calls.

Click Authorize to grant permission to this and future calls.


STEP: List the gcloud 

student_01_2cab0553971a@cloudshell:~ (qwiklabs-gcp-01-b6b0a57c3e87)$ gcloud auth list

Credentialed Accounts


ACTIVE: *

ACCOUNT: student-01-2cab0553971a@qwiklabs.net

To set the active account, run:

    $ gcloud config set account `ACCOUNT`


student_01_2cab0553971a@cloudshell:~ (qwiklabs-gcp-01-b6b0a57c3e87)$ 

Create a bucket

In this lab you use gcloud storage commands.

When you create a bucket you must follow the universal bucket naming rules, below.


Bucket naming rules


Do not include sensitive information in the bucket name, because the bucket namespace is global and publicly visible.

Bucket names must contain only lowercase letters, numbers, dashes (-), underscores (_), and dots (.). Names containing dots require verification.

Bucket names must start and end with a number or letter.

Bucket names must contain 3 to 63 characters. Names containing dots can contain up to 222 characters, but each dot-separated component can be no longer than 63 characters.

Bucket names cannot be represented as an IP address in dotted-decimal notation (for example, 192.168.5.4).

Bucket names cannot begin with the "goog" prefix.

Bucket names cannot contain "google" or close misspellings of "google".

Also, for DNS compliance and future compatibility, you should not use underscores (_) or have a period adjacent to another period or dash. For example, ".." or "-." or ".-" are not valid in DNS names.


Use the make bucket (buckets create) command to make a bucket, replacing <YOUR_BUCKET_NAME> with a unique name that follows the bucket naming rules:

gcloud storage buckets create gs://photobucket_rr

gcloud storage cp ada.jpg gs://photobucket_rr

gcloud storage cp -r gs://photobucket_rr/ada.jpg .

gcloud storage cp gs://photobucket_rr/ada.jpg gs://photobucket_rr/image-folder/

gcloud storage ls gs://photobucket_rr

gcloud storage ls -l gs://photobucket_rr/ada.jpg

gcloud storage objects update gs://photobucket_rr/ada.jpg --add-acl-grant=entity=allUsers,role=READER

gcloud storage objects update gs://photobucket_rr/ada.jpg --remove-acl-grant=allUsers

gcloud storage rm gs://photobucket_rr/ada.jpg


Sunday, August 23, 2026

Differences between gRPC, SSE, WebSockets

 The primary difference is their architectural purpose: gRPC is a high-performance framework designed mainly for internal backend microservices, WebSockets provide a persistent channel for two-way (bidirectional) web apps, and SSE (Server-Sent Events) is a simple protocol for one-way (server-to-client) streaming.


gRPC (Google Remote Procedure Call)How it works: A client invokes a function on a remote server as if it were a local function call. It relies strictly on HTTP/2, utilizing features like multiplexing to send multiple requests over one connection without blocking.Payload: Uses Protocol Buffers, which serialize data into a highly compressed binary format instead of readable text. This makes it lightning-fast but harder to debug manually.Strengths: Strict schema enforcement, type safety, and extreme data efficiency for internal backend networks.


WebSocketsHow it works: The client initiates a standard HTTP request and requests a protocol upgrade. Once accepted, the connection morphs into a persistent, raw TCP tunnel where both parties can push messages at any time simultaneously.Payload: Completely flexible. You can stream plain text, raw JSON strings, or binary blobs.Strengths: Low latency for high-frequency, two-way browser data exchanges.


SSE (Server-Sent Events)How it works: The client opens a standard, long-lived HTTP connection using the native browser EventSource interface. The server leaves this response window open indefinitely, pushing text events whenever new data updates arrive.Payload: Text-only. If you need to send binary data, it must be base64 encoded.Strengths: Minimal configuration, standard HTTP firewall compliance, and native handling of drops/reconnections out of the box


Which One to Choose?Choose gRPC if you are linking backend-to-backend infrastructure or mobile apps where network bandwidth and CPU cycles are highly constrained.Choose WebSockets if your client needs to constantly stream data back up to the server while receiving updates, such as inside a fast-paced multiplayer web game or a shared document editor.Choose SSE if your client just needs to sit back and listen to an outgoing feed, such as tracking a live sports score, waiting for system push notifications, or streaming real-time tokens from a Generative AI text API.

Playwright CLI vs standard cli

 Playwright-cli is a terminal-native command-line interface specifically built for AI coding agents to control web browsers. Developed by Microsoft as part of the official Playwright project, it allows terminal-based AI tools to click buttons, take screenshots, navigate pages, and extract data using lightweight shell commands rather than heavy API integrations. [1, 2, 3]  

Why  Was Built 

Before its launch, AI agents used the  Model Context Protocol (MCP)  to automate browsers. However, MCP is highly "token-hungry" because it continuously feeds large tool schemas and verbose webpage details into the AI's limited context window. [3, 4]  

The new  fixes this by introducing Skill-Based Workflows. Instead of sending massive webpage structures back and forth, the agent runs concise terminal commands, saving up to 70–80% on AI token costs. [3, 5, 6]  

Standard CLI () vs. New CLI () 

It is important not to confuse the new agent-focused tool with the traditional developer CLI: [6]  


| Feature | Standard CLI () | New Agent CLI ()  |

| --- | --- | --- |

| Target User | Human developers | AI Coding Agents (e.g., Claude Code, Copilot, Cursor)  |

| Primary Use | Running end-to-end test suites and debugging | Browser exploration and live UI automation  |

| Output Type | Human-readable test reports and code generation UI | Machine-readable YAML snapshots and local files  |

| Token Impact | None | Exceptionally low (saves heavy files to disk instead of LLM context)  |


How It Works (The Core "Skills") 

When you install the CLI, you can generate a  file using the command . This file functions as onboarding documentation that teaches the AI agent exactly what commands it is allowed to run. [3, 7]  

Common terminal actions include: 


• Opening a page:  

• Clicking an element:  

• Capturing the state:  

• Taking a visual check:  [6, 7]  


How to Install It 

The CLI can be installed globally via Node.js package manager: [8]  

Are you trying to configure  to work with a specific AI coding agent (like Claude Code or Cursor), or are you looking for traditional Playwright commands to run your own automated tests? 

AI responses may include mistakes.


[1] https://playwright.dev/agent-cli/introduction

[2] https://playwright-cli.com/

[3] https://www.youtube.com/watch?v=OaFmRHiKp68

[4] https://www.youtube.com/watch?v=CVxEOfGu7Nw

[5] https://playwright.dev/python/docs/getting-started-cli

[6] https://testdino.com/blog/playwright-cli

[7] https://testcollab.com/blog/playwright-cli

[8] https://playwright.dev/docs/getting-started-cli


What are Playwright Agents

 Playwright Agents are Large Language Model (LLM)-driven AI tools embedded natively into the Playwright test automation framework. Released in late 2025 (v1.56), they shift the testing paradigm from manually writing hardcoded test scripts ("how" to test) to describing goals in natural language ("what" to test).Unlike generic code generation tools that predict code based on abstract training data, Playwright Agents interact with real, live browser sessions, inspecting the actual Document Object Model (DOM) and accessibility trees to plan, write, and execute tests.The Three Core Playwright AgentsPlaywright comes with three specialized built-in agents that work independently, sequentially, or together in an autonomous "agentic loop" to handle the full testing lifecycle:🎭 Planner: Explores your live application URL and builds a structured test plan in Markdown format, identifying core user paths and edge cases.🎭 Generator: Reads the Markdown test plans created by the Planner and automatically converts them into fully executable, real Playwright test files (.spec.ts) containing proper selectors and assertions.🎭 Healer: Monitors the execution of the test suite. If a test fails due to a UI change or broken locator, the Healer replays the steps, identifies the change, suggests a patch, and repairs the test autonomously.Architecture and Integration OptionsPlaywright supports two distinct approaches for connecting Large Language Models to web automation:Playwright Model Context Protocol (MCP): Best for specialized agentic loops and exploratory automation. It allows LLMs to persistently inspect page structures, but has a higher token consumption cost due to rich context payloads.Playwright CLI: Designed for coding assistants (like GitHub Copilot or Claude Code). It is highly token-efficient, leveraging concise command-line tools and loaded skills on demand rather than heavy DOM schemas.Key BenefitsSelf-Healing Capabilities: Reduces test suite maintenance by fixing broken CSS/XPath selectors automatically when UI layouts change.Accelerated Bootstrapping: Speeds up development by converting high-level intent into working TypeScript tests in seconds.Real-world Verification: Operates within actual browser environments, executing and validating assertions against live DOM states.If you want to try them out, let me know:Which programming language or framework flavor you are using.Your current code editor (e.g., VS Code).If you want a quick setup guide to configure your first agentic loop.



Thursday, August 20, 2026

Is Playwrite MCP server is safe w.r.to Data?

 Yes, the Playwright Model Context Protocol (MCP) server primarily operates via standard input/output (stdio) and runs completely locally on your machine without connecting to any external cloud-hosted servers.However, because its core purpose is browser automation, the browser instance it controls will connect to external web servers whenever you command it to navigate to a live website.🌐 Understanding How Playwright MCP ConnectsLocal stdio Architecture: When configured in AI applications like Claude Desktop, Cursor, or GitHub Copilot CLI, the server runs entirely as a local sub-process. Communication between your AI app and the Playwright tool occurs over your computer's local stdin and stdout channels. No data from this communication channel is broadcast to the internet.Optional Local Network Modes: The Playwright MCP server can also be configured to run as a local HTTP/SSE server. Even in this mode, it is hosted locally on your device (localhost), though it is accessible to other local IDE tools or custom clients.Browser Internet Traffic: While the MCP connection itself is entirely isolated, the Playwright browser instance (Chromium/Chrome) will connect to external servers whenever the AI instructs it to browse a live URL (e.g., executing a command to scrape data from an external website or test an online application).🛡️ Enterprise Security & Data IsolationBecause it operates locally via stdio, none of your local application context, files, or login tokens are transmitted to an external MCP provider hosting server.However, you should keep the following two data flows in mind:The AI Model Provider: Any text, code, or page data that the Playwright MCP server scrapes from your browser window is fed back into your AI client, which then sends it to your AI provider (like Anthropic or OpenAI) to analyze the page content.Local Application Isolation: If you instruct the AI to browse a local development server (http://localhost:3000), the network traffic remains entirely within your local machine.Would you like assistance configuring the claude_desktop_config.json file to run Playwright MCP locally via stdio, or are you looking to restrict the browser from accessing specific external domains?

Playwright MCP server

 Introduction

The Playwright MCP server provides browser automation capabilities through the Model Context Protocol, enabling LLMs to interact with web pages using structured accessibility snapshots. It works with VS Code, Cursor, Windsurf, Claude Desktop, and any other MCP client — no vision models required.

Prerequisites

Before you begin, make sure you have the following installed:


Node.js 20 or newer

An MCP client: VS Code, Cursor, Windsurf, Claude Code, Claude Desktop, or similar

Getting Started

Installation

Add the Playwright MCP server to your client using the standard configuration:

{

  "mcpServers": {

    "playwright": {

      "command": "npx",

      "args": [

        "@playwright/mcp@latest"

      ]

    }

  }

}


VS Code

Click one of the buttons below to install directly:

Install in VS Code Install in VS Code Insiders

Or install via the VS Code CLI:

code --add-mcp '{"name":"playwright","command":"npx","args":["@playwright/mcp@latest"]}'

Cursor

Install in Cursor

Or go to Cursor Settings → MCP → Add new MCP Server and use command type with npx @playwright/mcp@latest.

Claude Code

claude mcp add playwright npx @playwright/mcp@latest

Claude Desktop

Follow the MCP install guide and use the standard config above.

Other clients

The standard configuration works with most MCP clients, including Windsurf, Cline, Goose, Kiro, Codex, Copilot CLI, and others. Consult your client's MCP documentation for where to place the config.

First interaction

Once the server is connected, ask your AI assistant to interact with a web page:

Navigate to https://demo.playwright.dev/todomvc and add a few todo items.

The assistant will use Playwright MCP tools to open the browser, navigate to the page, and interact with elements — all through structured accessibility snapshots rather than screenshots.

Core Features

Accessibility snapshots

Playwright MCP operates on the page's accessibility tree, not pixels. When a tool runs, it returns a structured snapshot showing the page elements, their roles, and text content. The LLM uses element references from these snapshots to interact with the page:

- heading "todos" [level=1]

- textbox "What needs to be done?" [ref=e5]

- listitem:

  - checkbox "Toggle Todo" [ref=e10]

  - text: "Buy groceries"

The LLM reads this snapshot and uses ref=e5 to type into the textbox or ref=e10 to check the checkbox.

Interacting with pages

Playwright MCP provides tools for all common browser interactions:

Navigation: Open URLs, go back/forward, reload pages.

Clicking and typing: Click elements, type text, fill forms, select dropdowns.

Screenshots: Capture the current page or specific elements for visual verification.

Keyboard and mouse: Press keys, hover, drag and drop.

Dialogs: Accept or dismiss browser dialogs.

Tabs: Create, close, and switch between browser tabs.

Running Playwright code

For complex interactions that go beyond individual tool calls, use the browser_run_code_unsafe tool to execute Playwright scripts directly. This tool runs arbitrary JavaScript in the Playwright server process and is RCE-equivalent — only enable it for trusted MCP clients:


Run this Playwright code to verify the todo count:

async (page) => {

  const count = await page.getByTestId('todo-count').textContent();

  return count;

}


Network monitoring and mocking

Inspect network traffic and mock API responses:


View network requests: List all requests made since page load.

Mock routes: Set up URL pattern matching to return custom responses.

Console messages: Access browser console output for debugging.

Storage state

Save and restore browser state including cookies and localStorage:


Save state: Persist authentication and session data to a file.

Restore state: Load previously saved state into a new session.

Cookie management: List, get, set, and delete individual cookies.

Configuration

Headed mode

By default, Playwright MCP runs the browser in headed mode so you can see what's happening. To run headless:


{

  "mcpServers": {

    "playwright": {

      "command": "npx",

      "args": [

        "@playwright/mcp@latest",

        "--headless"

      ]

    }

  }

}


Browser selection

Choose which browser to use:


{

  "mcpServers": {

    "playwright": {

      "command": "npx",

      "args": [

        "@playwright/mcp@latest",

        "--browser=firefox"

      ]

    }

  }

}


Supported values: chrome, firefox, webkit, msedge.


User profile

Playwright MCP supports three profile modes:


Persistent (default): Login state and cookies are preserved between sessions. The profile is stored in ms-playwright/mcp-{channel}-{workspace-hash} in your platform's cache directory, so different projects get separate profiles automatically. Override with --user-data-dir.

Isolated: Each session starts fresh. Pass --isolated to enable. You can load initial state with --storage-state.

Browser extension: Connect to your existing browser tabs with the Playwright Extension. Pass --extension to enable.

Configuration file

For advanced configuration, use a JSON config file:


npx @playwright/mcp@latest --config path/to/config.json


The config file supports browser options, context options, network rules, timeouts, and more. See the Playwright MCP repository for the full schema.


Standalone server

When running a headed browser on a system without a display or from IDE worker processes, start the MCP server separately with HTTP transport:


npx @playwright/mcp@latest --port 8931


HTTP sessions use a five-second heartbeat timeout. If your MCP client or proxy does not answer server-initiated pings, set PLAYWRIGHT_MCP_PING_TIMEOUT_MS to a longer timeout in milliseconds. Set it to 0 to disable the heartbeat.


Then point your MCP client to the HTTP endpoint:


{

  "mcpServers": {

    "playwright": {

      "url": "http://localhost:8931/mcp"

    }

  }

}


Quick Reference

Action How to do it

Install server Add standard config to your MCP client

Navigate to a page Ask: "Go to https://example.com"

Click an element Ask: "Click the Submit button"

Fill a form Ask: "Fill in the email field with test@example.com"

Take a screenshot Ask: "Take a screenshot of the page"

Run Playwright code Ask: "Run this Playwright code: ..."

Mock an API Ask: "Mock the /api/users endpoint to return ..."

Use headed mode Default. Pass --headless to disable

Choose a browser Pass --browser=firefox in args


Tuesday, August 18, 2026

How to map Claude extension features to goals ?

 


This is best overview of how to match the goal and the features that Claude provides. 


How to extend the claude functionalities? What are diferent ways

Extensions plug into different parts of the agentic loop:

CLAUDE.md adds persistent context Claude sees every session

Skills add reusable knowledge and invocable workflows

Code intelligence connects Claude to a language server for symbol-level navigation and live type errors

MCP connects Claude to external services and tools

Subagents run their own loops in isolated context, returning summaries

Agent teams coordinate multiple independent sessions with peer-to-peer messaging, plus a shared task list for agents that have the Task tools

Hooks run your script, HTTP request, prompt, or subagent when Claude Code reaches a lifecycle event

Plugins and marketplaces package and distribute these features

Skills are the most flexible extension. A skill is a markdown file containing knowledge, workflows, or instructions. You can invoke skills with a command like /deploy, or Claude can load them automatically when relevant. Skills can run in your current conversation or in an isolated context via subagents.


Sunday, August 16, 2026

How to work effectively with Claude Code?

 Work effectively with Claude Code

These tips help you get better results from Claude Code.

Ask Claude Code for help

Claude Code can teach you how to use it. Ask questions like “how do I set up hooks?” or “what’s the best way to structure my CLAUDE.md?” and Claude will explain.

Built-in commands also guide you through setup:

/init walks you through creating a CLAUDE.md for your project

/doctor runs a setup checkup that diagnoses installation and configuration issues and can fix them

It’s a conversation

Claude Code is conversational. You don’t need perfect prompts. Start with what you want, then refine:

Fix the login bug

[Claude investigates, tries something]

That's not quite right. The issue is in the session handling.

[Claude adjusts approach]

When the first attempt isn’t right, you don’t start over. You iterate.

Interrupt and steer

You can redirect Claude at any point without waiting for the turn to finish or starting over:

Press Esc to stop Claude immediately. The running tool call is canceled and Claude waits for your next instruction.

Type a correction and press Enter to send it without stopping the running tool. Claude reads it as soon as the current action completes and adjusts before deciding its next step.

Be specific upfront

The more precise your initial prompt, the fewer corrections you’ll need. Reference specific files, mention constraints, and point to example patterns.

The checkout flow is broken for users with expired cards.

Check src/payments/ for the issue, especially token refresh.

Write a failing test first, then fix it.

Vague prompts work, but you’ll spend more time steering. Specific prompts like the one above often succeed on the first attempt.

Give Claude something to verify against

Claude performs better when it can check its own work. Include test cases, paste screenshots of expected UI, or define the output you want.

Implement validateEmail. Test cases: 'user@example.com' → true,

'invalid' → false, 'user@.com' → false. Run the tests after.

For visual work, paste a screenshot of the design and ask Claude to compare its implementation against it.

Explore before implementing

For complex problems, separate research from coding. Use plan mode (Shift+Tab twice) to analyze the codebase first:

Read src/auth/ and understand how we handle sessions.

Then create a plan for adding OAuth support.

Review the plan, refine it through conversation, then let Claude implement. This two-phase approach produces better results than jumping straight to code.

Delegate, don’t dictate

Think of delegating to a capable colleague. Give context and direction, then trust Claude to figure out the details:

The checkout flow is broken for users with expired cards.

The relevant code is in src/payments/. Can you investigate and fix it?

LLM Watermarking

 Future Claude models will generate text that contains a watermark. This is a way of determining the likelihood that Claude was involved in writing the text, and we, along with several other major AI providers, are implementing this change to comply with the EU AI Act.


In this article, we share answers to some of the questions we’ve received about how our chosen watermarking method works, whether it affects Claude’s outputs, and why we’re making this change. To summarize:


We use a method of watermarking that does not have any practical impact on the quality or content of Claude’s outputs;

The difference between watermarked and un-watermarked text will not be distinguishable to readers;

Nothing is added to the text and there are no hidden characters;

Watermarking doesn’t require extra tokens, and will not be more expensive;

Watermarking carries no identifying information and can’t be traced to a specific person, organization, or chat;

Watermarking won’t be specific to Claude. As of August 2, the EU requires AI providers serving its market to mark AI-generated content. Other major model developers have signed the same Code of Practice and will be implementing their own watermarks.

What is watermarking?

Large language models like Claude work by generating one word at a time. Each time the model decides on the next word, it chooses among a list of potential candidates, ultimately selecting the most sensible or likely based on the preceding text. Take the sentence “The weather today was cold and…”. The next word is very unlikely to be “sugary.” But it is quite likely to be “overcast” or “grey.” Under most circumstances, it doesn’t matter much to the reader which of these latter two words the model ultimately chooses—the meaning of the sentence is largely the same either way. In cases like this, the choice is settled by a random number.


Watermarking uses low-stakes choices like these—which occur many times over a piece of generated text—to leave a pattern in Claude’s responses. That pattern is undetectable to the reader, but is detectable to anyone who has a key that encodes it. When watermarking is used, choices are still made at random, but the source of the randomness is different. Instead of using an arbitrary random number generator to pick the next word, watermarking uses the key and a few words that come before to settle what word the model should pick. That is, the words that Claude picks are still random, but now, one can check the sequence of words and see if it’s consistent with the choices Claude would make if it was using the key. If it is, one can assign a probability that the text was generated by Claude.


Importantly, it isn’t that the model will now always be biased toward overcast or grey. Just as with non-watermarked text, overcast might be selected in one sentence, grey in the next, depending on the words that came before. And it’s not the case that the watermarking method pushes Claude to choose a word it wouldn’t have considered anyway (for instance, it wouldn’t make Claude pick a word like “nubilous”—an obscure1 synonym for overcast or grey that Claude almost certainly wouldn’t use under normal circumstances).

Details about Claude Context Window, Subagents and Memory

 The context window

Claude’s context window holds your conversation history, file contents, command outputs, CLAUDE.md, auto memory, loaded skills, and system instructions. As you work, context fills up. Claude compacts automatically, but instructions from early in the conversation can get lost. Put persistent rules in CLAUDE.md, and run /context to see what’s using space.

For an interactive walkthrough of what loads and when, see Explore the context window.

When context fills up

Claude Code manages context automatically as you approach the limit. It clears older tool outputs first, then summarizes the conversation if needed. Your requests and key code snippets are preserved; detailed instructions from early in the conversation may be lost. Put persistent rules in CLAUDE.md rather than relying on conversation history.

To control what’s preserved during compaction, add a “Compact Instructions” section to CLAUDE.md or run /compact with a focus (like /compact focus on the API changes).

If a single file or tool output is so large that context refills immediately after each summary, Claude Code stops auto-compacting after a few attempts and shows an error instead of looping. See Auto-compaction stops with a thrashing error for recovery steps.

Run /context to see what’s using space. MCP tool definitions are deferred by default and loaded on demand via tool search, so only tool names consume context until Claude uses a specific tool. Run /mcp to check per-server costs.

Manage context with skills and subagents

Beyond compaction, you can use other features to control what loads into context.

Skills load on demand. Claude sees skill descriptions at session start, but the full content only loads when a skill is used. For skills you invoke manually, set disable-model-invocation: true to keep descriptions out of context until you need them. For skills you didn’t write, use skillOverrides to do the same from settings.

Subagents get their own fresh context, completely separate from your main conversation. Their work doesn’t bloat your context. When done, they return a summary. This isolation is why subagents help with long sessions.

See context costs for what each feature costs, and reduce token usage for tips on managing context.

Stay safe with checkpoints and permissions

Claude has two safety mechanisms: checkpoints let you undo file changes, and permissions control what Claude can do without asking.

Undo changes with checkpoints

File edits are reversible. Before Claude edits a file, it snapshots the current contents. If something goes wrong, press Esc twice to rewind to a previous state, or ask Claude to undo.

Checkpoints are separate from git and remain available when you resume a conversation. They only cover file changes, and a restore skips symlinked and hard-linked files. Actions that affect remote systems (databases, APIs, deployments) can’t be checkpointed, which is why Claude asks before running commands with external side effects.

Control what Claude can do

Press Shift+Tab to cycle through permission modes:

Manual: Claude asks before file edits and shell commands

Accept edits: Claude edits files and runs common filesystem commands like mkdir and mv without asking, still asks for other commands

Plan: Claude explores and proposes a plan without editing your source files

Auto: Claude evaluates all actions with background safety checks

You can also allow specific commands in .claude/settings.json so Claude doesn’t ask each time. This is useful for trusted commands like npm test or git status. Settings can be scoped from organization-wide policies down to personal preferences. See Permissions for details.


details about Claude Models , Claude Tools, Memory , Environments and Interfaces

 Claude Models 

=============


Claude Code uses Claude models to understand your code and reason about tasks. Claude can read code in any language, understand how components connect, and figure out what needs to change to accomplish your goal. For complex tasks, it breaks work into steps, executes them, and adjusts based on what it learns.


Multiple models are available with different tradeoffs. Sonnet handles most coding tasks well. Opus provides stronger reasoning for complex architectural decisions. Switch with /model during a session or start with claude --model <name>.




Claude Tools

===========

Tools are what make Claude Code agentic. Without tools, Claude can only respond with text. With tools, Claude can act: read your code, edit files, run commands, search the web, and interact with external services. Each tool use returns information that feeds back into the loop, informing Claude’s next decision.



The built-in tools generally fall into five categories, each representing a different kind of agency.

Category What Claude can do

File operations Read files, edit code, create new files, rename and reorganize

Search Find files by pattern, search content with regex, explore codebases

Execution Run shell commands, start servers, run tests, use git

Web Search the web, fetch documentation, look up error messages

Code intelligence See type errors and warnings after edits, jump to definitions, find references (requires code intelligence plugins)




Claude chooses which tools to use based on your prompt and what it learns along the way. When you say “fix the failing tests,” Claude might:

Run the test suite to see what’s failing

Read the error output

Search for the relevant source files

Read those files to understand the code

Edit the files to fix the issue

Run the tests again to verify

Each tool use gives Claude new information that informs the next step. This is the agentic loop in action.



Extending the base capabilities: The built-in tools are the foundation. You can extend what Claude knows with skills, connect to external services with MCP, automate workflows with hooks, and offload tasks to subagents. These extensions form a layer on top of the core agentic loop. 



What Claude can access

When you run claude in a directory, Claude Code gains access to:

Your project. Files in your directory and subdirectories, plus files elsewhere with your permission.

Your terminal. Any command you could run: build tools, git, package managers, system utilities, scripts. If you can do it from the command line, Claude can too.

Your git state. Current branch, uncommitted changes, and recent commit history.

Your CLAUDE.md. A markdown file where you store project-specific instructions, conventions, and context that Claude should know every session.

Auto memory. Learnings Claude saves automatically as you work, like project patterns and your preferences. The first 200 lines or 25KB of MEMORY.md, whichever comes first, load at the start of each session.

Extensions you configure. MCP servers for external services, skills for workflows, subagents for delegated work, and Claude in Chrome for browser interaction.

Because Claude sees your whole project, it can work across it. When you ask Claude to “fix the authentication bug,” it searches for relevant files, reads multiple files to understand context, makes coordinated edits across them, runs tests to verify the fix, and commits the changes if you ask. This is different from inline code assistants that only see the current file.



Environments and interfaces

The agentic loop, tools, and capabilities described above are the same everywhere you use Claude Code. What changes is where the code executes and how you interact with it.

Execution environments

Claude Code runs in three environments, each with different tradeoffs for where your code executes.

Environment Where code runs Use case

Local Your machine Default. Full access to your files, tools, and environment

Cloud Anthropic-managed VMs, or self-hosted environments your organization operates Offload tasks, work on repos you don’t have locally

Remote Control Your machine, controlled from a browser Use the web UI while execution and your files stay local




Work with sessions

Claude Code saves your conversation locally as you work. Each message, tool use, and result is written to a plaintext JSONL file under ~/.claude/projects/, which enables rewinding, resuming, and forking sessions. Before Claude makes code changes, it also snapshots the affected files so you can revert if needed. For paths, retention, and how to clear this data, see application data in ~/.claude.

Sessions are independent. Each new session starts with a fresh context window, without the conversation history from previous sessions. Claude can persist learnings across sessions using auto memory, and you can add your own persistent instructions in CLAUDE.md.

Work across branches

Each Claude Code conversation is a session tied to your current directory. The /resume picker shows sessions from the current worktree by default, with keyboard shortcuts to widen the list to other worktrees or projects. See Manage sessions for the full list of picker shortcuts and how name resolution works.

Claude sees your current branch’s files. When you switch branches, Claude sees the new branch’s files, but your conversation history stays the same. Claude remembers what you discussed even after switching.

Since sessions are tied to directories, you can run parallel Claude sessions by using git worktrees, which create separate directories for individual branches.



How Claude Code works - Basics

Claude Code is an agentic coding tool that reads your codebase, edits files, runs commands, and integrates with your development tools. Available in your terminal, IDE, desktop app, and browser.

Claude Code is an AI-powered coding assistant that helps you build features, fix bugs, and automate development tasks. It understands your entire codebase and can work across multiple files and tools to get things done.

Claude Code runs on several surfaces: the terminal, IDE extensions, a desktop app, and the web. Choose one from the tabs below to get started. Most surfaces require a Claude subscription or Anthropic Console account. The Terminal CLI and VS Code also support third-party providers.

Claude Code is an agentic assistant that runs in your terminal. While it excels at coding, it can help with anything you can do from the command line: writing docs, running builds, searching files, researching topics, and more.

The agentic loop

When you give Claude a task, it works through three phases: gather context, take action, and verify results. These phases blend together. Claude uses tools throughout, whether searching files to understand your code, editing to make changes, or running tests to check its work.

The loop adapts to what you ask. A question about your codebase might only need context gathering. A bug fix cycles through all three phases repeatedly. A refactor might involve extensive verification. Claude decides what each step requires based on what it learned from the previous step, chaining dozens of actions together and course-correcting along the way.

You’re part of this loop too. You can interrupt at any point to steer Claude in a different direction, provide additional context, or ask it to try a different approach. Claude works autonomously but stays responsive to your input.

The agentic loop is powered by two components: models that reason and tools that act. Claude Code serves as the agentic harness around Claude: it provides the tools, context management, and execution environment that turn a language model into a capable coding agent.

Saturday, August 15, 2026

Kiro with MCP kb

 

You already have a Knowledge Base

If your team already uses Amazon Bedrock Knowledge Bases, whether it was built for a chatbot, an internal search tool, or a customer-facing assistant, you don’t need to rebuild anything. Your existing Knowledge Base works with Kiro out of the box.

Here’s the approach:

  1. Tag your existing Knowledge Base with mcp-multirag-kb=true. This is how the MCP server discovers it.
  2. Configure the MCP server in Kiro (covered in the next section). Your documents, your embeddings, your vector store, all stay exactly where they are.

The official awslabs.bedrock-kb-retrieval-mcp-server auto-discovers Knowledge Bases with that tag. If you have multiple Knowledge Bases (one for API docs, another for architecture decisions, a third for runbooks), tag them all. Kiro can query across your tagged Knowledge Bases.

Friday, August 14, 2026

What is Wikipedia Stream event?

 


The [https://stream.wikimedia.org/v2/stream/recentchange](https://stream.wikimedia.org/v2/stream/recentchange) endpoint is part of the Wikimedia EventStreams service. It provides a real-time, public "firehose" of activity happening across all Wikimedia wikis (including all language versions of Wikipedia, Wiktionary, Commons, etc.).


Here are the key details about how it works and how to use it:


1. How It Works

Format: It uses Server-Sent Events (SSE), an HTTP-based standard that allows servers to "push" data to clients.


Protocol: You connect to it as a standard HTTP stream. In most programming languages, you use an EventSource client library.


Underlying Tech: The stream is backed by Apache Kafka, which aggregates events from various MediaWiki installations before broadcasting them.


2. What Data You Get

Every time an action occurs on a Wikimedia site, a JSON-formatted event is pushed through the stream. These events include:


Edits: The most common event, detailing changes to articles.


User actions: New page creations, user registrations, and other log actions.


Metadata: Information like the wiki (e.g., enwiki), the user (or IP for anonymous edits), the title of the page, a timestamp, and the comment (edit summary).


3. Best Practices for Implementation

Use a Custom User-Agent: Wikimedia strictly requires a descriptive User-Agent header for all requests to their APIs/streams to identify your project and contact information. Requests with default or missing headers are frequently blocked or rate-limited.


Handle "Canary" Events: Occasionally, you will receive "canary" events used for monitoring the stream itself. You should filter these out (they are usually identified by meta.domain === 'canary').


Client-Side Filtering: The stream is a massive firehose. Since server-side filtering is not natively supported by the HTTP endpoint, your client code must perform filtering (e.g., by checking server_name or wiki) to process only the data you care about.


Resilience: Because network connections to a live stream can drop, implement an infinite loop with a reconnection strategy (as you did in your code) to ensure your service remains unattended and active.


Summary of Resources

Official Documentation: Wikitech: EventStreams.


MediaWiki API Help: API:Recent changes stream.


Tuesday, August 11, 2026

What is Muse Glimmer . How to get started with it in Ollama

Muse Glimmer is a 30-billion-parameter causal language model with a dedicated perception encoder, distilled from Muse Spark and purpose-built for autonomous agentic tasks on consumer hardware. The model integrates multi-step reasoning, reliable tool use, multimodal understanding, and failure recovery into a single model that runs locally without requiring cloud infrastructure or network access.


Get started

To download and run Muse Glimmer with Ollama, use:


ollama run muse-glimmer

Ollama’s MLX engine provides state-of-the-art performance on Apple Silicon, with support for DFlash and image input:


ollama run muse-glimmer:30b-mlx

Model information

End-to-end Agentic Task Completion. Muse Glimmer achieves strong success rates on full-task benchmarks including DeepSearch QA, MCP-Atlas, 𝛕3-Bench and SWE-Bench, which measure its ability to work within scaffolds, write and debug code, and resolve multi-turn requests from start to finish.

Reliable Tool Use. The model handles a wide range of function calls, invoking tools with precise schemas throughout extended workflows.

Multi-Step Reasoning. Muse Glimmer chains reasoning over long horizons, sustaining coherent plans across complex, extended workflows.

Failure Recovery. When a tool call fails or returns an unexpected result, the model diagnoses the error and retries rather than halt.

Multimodal Input and Reasoning. Through a dedicated perception encoder, the model accepts interleaved text and images. This enables agents to interpret screenshots, charts, and documents alongside conversation.

Scaffold Compatibility. Muse Glimmer works across OpenClaw, Hermes Agent, and other agentic orchestration patterns.

Controllable Effort. The model supports different reasoning strengths to select the right balance between quality and speed.

Multilingual. Muse Glimmer is trained on data from more than 100 languages.


What are the major differences between dot product vs Cosine similarity ?

 



Sunday, August 9, 2026

Why cosine similarity better than dot product?

 Yes. This is actually an important next step because it lets you explain why a recommendation system often prefers cosine similarity over a raw dot product.

You can add the following section after your dot-product example.

Dot Product vs. Cosine Similarity

The dot product gives us a useful compatibility score, but there is an important limitation.

The dot product depends on both:

  1. The direction of the vectors — whether the user and movie have similar preferences.
  2. The magnitude (length) of the vectors — how large the numbers are overall.

Cosine similarity, on the other hand, focuses primarily on the direction of the vectors.

ab=axbx+ayby=abcosθ\mathbf a\cdot\mathbf b=a_xb_x+a_yb_y=\lVert\mathbf a\rVert\lVert\mathbf b\rVert\cos\theta
ab=4(1)+1(3)=1\mathbf a\cdot\mathbf b=4(-1)+1(3)=-1
The angle is obtuse, so the vectors point partly apart and the dot product is negative
Inputs
axa_x
aya_y
bxb_x
byb_y
Drag vector a or b
-6-4-2246-6-4-2246xxyyθ = 94.4°a = (4, 1)b = (-1, 3)

The mathematical relationship

For two vectors AA and BB:

AB=ABcos(θ)A \cdot B = \|A\|\|B\|\cos(\theta)

where:

  • ABA \cdot B = dot product
  • A\|A\| = magnitude of vector AA
  • B\|B\| = magnitude of vector BB
  • θ\theta = angle between the two vectors

Cosine similarity removes the magnitude component:

Cosine Similarity(A,B)=ABAB\boxed{ \text{Cosine Similarity}(A,B) = \frac{A\cdot B}{\|A\|\|B\|} }

Therefore:

Cosine Similarity(A,B)=cos(θ)\boxed{ \text{Cosine Similarity}(A,B)=\cos(\theta) }

For normalized vectors, the dot product and cosine similarity become the same value.


Why Does This Matter for Recommendations?

Let's make the difference very concrete.

Suppose we have two users.

User A

This user watches a lot of movies but strongly prefers Action and Sci-Fi:

A=[9,1,8]A=[9,1,8]

User B

This user watches fewer movies but has almost exactly the same preference pattern:

B=[4.5,0.5,4]B=[4.5,0.5,4]

Notice something interesting.

User B's vector is exactly half of User A:

B=0.5AB=0.5A

So the two users have the same preference pattern, but User A has larger values.


Using Dot Product

Calculate:

ABA\cdot B =(9×4.5)+(1×0.5)+(8×4)=(9\times4.5)+(1\times0.5)+(8\times4) =40.5+0.5+32=40.5+0.5+32 73\boxed{73}

The dot product is 73.

Now imagine another user:

C=[1,1,1]C=[1,1,1]

Calculate:

ACA\cdot C =(9×1)+(1×1)+(8×1)=(9\times1)+(1\times1)+(8\times1) =18=18

So:

AB=73A\cdot B=73

while:

AC=18A\cdot C=18

The dot product strongly favors B.

But there is an important question:

Is B really more similar to A, or does B simply have large numerical values in the same dimensions?


Cosine Similarity Removes the Magnitude Problem

First calculate the magnitude of AA:

A=92+12+82\|A\|=\sqrt{9^2+1^2+8^2} =81+1+64=\sqrt{81+1+64} =146=\sqrt{146} 12.08\approx12.08

For B:

B=4.52+0.52+42\|B\|=\sqrt{4.5^2+0.5^2+4^2} =20.25+0.25+16=\sqrt{20.25+0.25+16} =36.5=\sqrt{36.5} 6.04\approx6.04

Now calculate cosine similarity:

Cosine(A,B)=7312.08×6.04\text{Cosine}(A,B) = \frac{73}{12.08\times6.04} 7373\approx\frac{73}{73} Cosine(A,B)1.0\boxed{\text{Cosine}(A,B)\approx1.0}

That makes sense.

The two vectors point in exactly the same direction.

Even though their magnitudes are different, their preference patterns are identical.


An Even More Important Example

Now consider:

D=[90,10,80]D=[90,10,80]

This could represent a user who has watched many more movies, but whose relative preferences are the same.

Notice:

D=10AD=10A

Therefore A and D have exactly the same preference pattern.

Their cosine similarity is:

Cosine(A,D)=1\boxed{\text{Cosine}(A,D)=1}

because they point in exactly the same direction.

But look at the dot product:

ADA\cdot D =(9×90)+(1×10)+(8×80)=(9\times90)+(1\times10)+(8\times80) =810+10+640=810+10+640 =1460=\boxed{1460}

So we have:

ComparisonDot ProductCosine Similarity
A vs B731.00
A vs D14601.00

This is the key difference.

A and B are just as similar as A and D in terms of preference pattern, but the dot product gives D a dramatically larger score because D has a much larger magnitude.

Cosine similarity correctly recognizes that:

"The two users have the same preference direction, regardless of how large their individual values are."


Visual Intuition: Direction vs. Length

Think of each vector as an arrow.

The length of the arrow represents magnitude.

The direction of the arrow represents the pattern of preferences.

Two users could have:

User A:  ───────────────►
User B:  ───────►

They have different magnitudes, but they point in the same direction.

Therefore:

θ=0\theta=0^\circ

and:

cos(0)=1\cos(0^\circ)=1

So their cosine similarity is:

1\boxed{1}

This means maximum similarity.


Why Cosine Similarity Is Often Better for Recommendation

Suppose two users have the following preferences:

User 1

[9,1,8,0,1][9,1,8,0,1]

User 2

[0.9,0.1,0.8,0,0.1][0.9,0.1,0.8,0,0.1]

Their values are very different in magnitude.

But their preference pattern is identical.

Both users essentially say:

"I strongly prefer Action and Sci-Fi, have very little interest in Comedy and Romance."

Cosine similarity identifies this immediately.

The dot product, however, is influenced by the absolute magnitude of the vectors.

This can be problematic when the magnitude represents something unrelated to the actual similarity we want to measure.

For example, magnitude might be affected by:

  • number of movies watched
  • number of ratings given
  • amount of interaction
  • frequency of activity
  • length of a document
  • number of words in a document

In these situations, we often care more about the pattern of preferences than the absolute amount of activity.

That is where cosine similarity becomes particularly useful.


But Is Cosine Similarity Always Better?

No.

This is an important point for a machine-learning explanation.

Cosine similarity isn't universally better than dot product.

They answer slightly different questions.

Dot Product asks:

"How strong is the overall interaction between these two vectors?"

It considers both:

alignment+magnitude\text{alignment} + \text{magnitude}

Cosine Similarity asks:

"How similar is the direction or pattern of these two vectors?"

It primarily considers:

alignment\text{alignment}

So the choice depends on what the numbers represent.


A Simple Real-World Analogy

Imagine two customers buying products.

Customer A

Buys:

  • 10 Action movies
  • 2 Comedy movies
  • 8 Sci-Fi movies
A=[10,2,8]A=[10,2,8]

Customer B

Buys:

  • 1 Action movie
  • 0.2 Comedy movies
  • 0.8 Sci-Fi movies
B=[1,0.2,0.8]B=[1,0.2,0.8]

Customer B has the same preference pattern, but much less activity.

Cosine similarity says:

"Their interests are almost identical."

Dot product says:

"Customer A has a much stronger overall interaction."

Both statements can be useful.

If we're trying to identify similar users based on taste, cosine similarity may be more appropriate.

If we're trying to predict strength of interaction or preference, the magnitude may actually contain valuable information, so a dot product can be preferable.


The Connection to Machine Learning

This distinction becomes even more important when we move from our simple genre example to embeddings.

Suppose a movie is represented by a 768-dimensional embedding:

Movie=[m1,m2,,m768]Movie=[m_1,m_2,\ldots,m_{768}]

and a user is represented by:

User=[u1,u2,,u768]User=[u_1,u_2,\ldots,u_{768}]

The dot product is:

UserMovie=i=1768uimiUser\cdot Movie = \sum_{i=1}^{768}u_i m_i

Cosine similarity is:

i=1768uimii=1768ui2i=1768mi2\boxed{ \frac{ \sum_{i=1}^{768}u_i m_i }{ \sqrt{\sum_{i=1}^{768}u_i^2} \sqrt{\sum_{i=1}^{768}m_i^2} } }

Now the difference becomes very important.

For embedding-based systems such as:

  • semantic search
  • RAG
  • document retrieval
  • recommendation systems
  • image similarity
  • text similarity

we frequently care about whether two embeddings point in similar directions, rather than simply whether their raw values are large.

That's why cosine similarity is so common in embedding-based retrieval.


One Very Important Exception

There is an interesting mathematical shortcut.

If we normalize every vector to length 1, then:

A=1\|A\|=1

and:

B=1\|B\|=1

Therefore:

Cosine Similarity(A,B)=AB1×1\text{Cosine Similarity}(A,B) = \frac{A\cdot B}{1\times1}

which gives:

Cosine Similarity(A,B)=AB\boxed{ \text{Cosine Similarity}(A,B)=A\cdot B }

So after L2 normalization:

Cosine similarity is simply the dot product of the normalized vectors.

This is an extremely useful connection when you later discuss vector databases and embedding search.


The Final Takeaway

You can summarize the entire concept with this comparison:

PropertyDot ProductCosine Similarity
Measures alignment
Considers magnitude
Measures angle/directionIndirectly
Sensitive to vector length
RangeDepends on vectors-1 to 1
Good for preference strengthSometimes
Good for pattern similaritySometimes
Common for embeddings
Same after normalizationYes

The conceptual difference can therefore be stated very simply:

Dot Product=Similarity of direction×Magnitude\boxed{ \text{Dot Product} = \text{Similarity of direction} \times \text{Magnitude} }

while:

Cosine Similarity=Similarity of direction only\boxed{ \text{Cosine Similarity} = \text{Similarity of direction only} }

And for your recommendation-engine example, this gives you a natural progression:

User preferences → Movie features → Dot Product → Problem with magnitude → Cosine Similarity → Normalized embeddings → Vector/embedding search.

That progression will make the mathematics connect nicely to modern recommendation systems, RAG and vector databases.