Resolving CORS Errors When Fetching Images from AWS S3 with Signed URLs

If you’re displaying images stored in an AWS S3 private bucket using signed URLs, you might have encountered a confusing scenario: images display perfectly in your web pages but throw CORS errors when you try to download them using JavaScript’s fetch API. Let’s break down the issue and explore a practical solution. Understanding the Problem Imagine you have your images securely stored in a private S3 bucket, and you’re using pre-signed URLs to grant temporary access: ...

June 29, 2025 · 3 min · Nitin

ComfyUI API Endpoints Guide: Complete Reference for Image Generation Workflows

Introduction ComfyUI is a powerful, open-source, node-based interface for generative AI workflows, majorly for image and video workflows. While it’s primarily known for its visual interface, ComfyUI also offers robust API capabilities, enabling developers to integrate and automate workflows programmatically. This guide will walk you through using ComfyUI in API mode. ComfyUI offers a suite of RESTful and WebSocket API endpoints that enable developers to programmatically interact with its workflow engine. These endpoints facilitate tasks such as queuing prompts, retrieving results, uploading images, and monitoring system status. ...

June 1, 2025 · 3 min · Nitin

Building Robust Systems: Key Lessons from Designing Data-Intensive Applications Chapter 1

Introduction If you’re involved in building software today, chances are you’re dealing with data. Lots of it. Maybe it’s user activity, sensor readings, financial transactions, or something else entirely. Martin Kleppmann’s phenomenal book, “Designing Data-Intensive Applications” (often called DDIA), is practically required reading for navigating this landscape. Let’s dive into some key takeaways from this essential chapter. The Shift: It’s About the Data, Not Just the CPU The chapter opens by highlighting a crucial distinction: many modern applications are data-intensive, not compute-intensive. While CPU power is abundant, the real challenges often lie in: ...

May 4, 2025 · 5 min · Nitin

Tokenization

Natural Language Processing (NLP) has revolutionized the way machines understand human language. But before models can learn from text, they need a way to break it down into smaller, understandable units. This is where tokenization comes in — a critical preprocessing step that transforms raw text into a sequence of meaningful components, or tokens.## 🧠 What is Tokenization? Tokenization is the process of splitting text into smaller units called tokens. These tokens can be as large as words, or as small as characters or subwords. ...

April 18, 2025 · 3 min · Nitin

Model Context Protocol (MCP) – A Technical Guide to Understanding and Building MCP Servers

Introduction to MCP The Model Context Protocol (MCP) is an open standard for connecting AI assistants (like large language models) to the systems where data and tools live​ In essence, MCP aims to bridge the gap between isolated AI models and real-world data sources – think of it as a “USB-C for AI applications”, providing a universal way to plug an AI model into various databases, file systems, APIs, and other tools​. ...

March 24, 2025 · 15 min · Nitin

WebRTC Signaling & Connection Establishment

What is Signaling in WebRTC, and Why is it Needed? WebRTC allows direct peer-to-peer (P2P) communication, but before two peers can connect, they need to exchange network and media information. This process is called signaling. Signaling is needed for: Exchanging session descriptions (SDP – Session Description Protocol) between peers. Sharing ICE candidates to determine the best network path. Handling NAT traversal by identifying public and private network addresses. Establishing data channels for text, files, and other non-media communication. WebRTC does not define a signaling protocol. Developers must implement their own using available technologies like WebSockets, WebRTC Data Channels, or existing protocols like SIP. ...

February 7, 2025 · 4 min · Nitin

WebRTC Fundamentals

WebRTC (Web Real-Time Communication) is an open-source project that enables real-time communication between browsers and devices using peer-to-peer connections. It allows audio, video, and data sharing without requiring additional plugins or external software. How Does WebRTC Work? WebRTC works by establishing a direct connection between two peers (browsers or applications) to transmit media (audio/video) and data. The connection process involves several steps: Media Capture – A user’s camera and microphone are accessed. Signaling – Exchanging connection details between peers via a signaling server (e.g., using WebSockets). ICE Candidate Discovery – Finding the best network path between peers. Connection Establishment – Securely connecting the peers. Data Transmission – Streaming audio/video or sending arbitrary data. 2. Main Components of WebRTC WebRTC consists of three primary components: ...

February 7, 2025 · 3 min · Nitin

DeepSeek R1: A Deep Dive into Algorithmic Innovations

The recent release of DeepSeek R1 has generated significant buzz in the AI community. While much of the discussion has centered on its performance relative to models like OpenAI’s GPT-4 and Anthropic’s Claude, the real breakthrough lies in the underlying algorithmic innovations that make DeepSeek R1 both highly efficient and cost-effective. This post explores the key technical advancements that power DeepSeek’s latest model. Model Architecture and Training DeepSeek R1 is part of a broader model ecosystem, and it’s essential to distinguish between two key models: ...

February 6, 2025 · 5 min · Nitin

Supervised Fine-Tuning (SFT)

What is Supervised Fine-Tuning (SFT)? Supervised fine-tuning is a training strategy where a pre-trained language model is further refined on a carefully curated dataset of prompt-response pairs. The primary goal is to “teach” the model how to generate appropriate, contextually relevant, and human-aligned responses. Key points about SFT include: Data Curation: The model is exposed to a dataset that contains high-quality examples—often created by human annotators—that demonstrate the desired behavior (e.g., step-by-step reasoning, correct coding outputs, or helpful dialogue responses). Instruction Following: By training on these examples, the model learns to interpret prompts as instructions and produce answers that mimic the reasoning and style of the training data. Limitations: While SFT works well to instill basic response quality, it is typically limited by the dataset’s scope and may not encourage the model to “think” beyond what is explicitly provided. Furthermore, excessive fine-tuning can lead to overfitting and reduce the model’s ability to generalize to unseen tasks. For many contemporary language models, SFT is the standard method used to bridge the gap between raw pre-training and interactive, user-facing performance. ...

February 2, 2025 · 5 min · Nitin

Kokoro: High-Quality Text-to-Speech(tts) on Your CPU with ONNX

This sound is generated with Kokoro tts The world of text-to-speech (TTS) has seen incredible advancements, but often these powerful models require hefty hardware like GPUs. But what if you could run a top-tier TTS model locally on your CPU? Enter **Kokoro**, a game-changing TTS model that delivers impressive results even on resource-constrained devices. Kokoro: Small but Mighty Kokoro stands out for its remarkable efficiency. With just 82 million parameters, it outperforms models several times its size, including XTTS (467M parameters) and MetaVoice (1.2B parameters). This proves that cutting-edge TTS is achievable without relying on massive models and powerful GPUs. ...

January 12, 2025 · 3 min · Nitin