Pinned Tweet
Haiku 5.5 is live on Claude Platform and Claude Code ๐
~75% cheaper than Haiku 4.5. $0.10 / $0.50 per MTok under 100K (cache reads $0.01) ๐ธ
Fast subagent for summaries, queries, and parallel work next to Opus or Sonnet โก
๐ LLM Quantisation explained (beyond just โuse 4-bitโ)
Reducing precision on weights, activations and KV cache cuts memory + data movement a lot but bit width alone doesnโt decide accuracy, speed or VRAM.
Key decisions that actually matter:
1๏ธโฃ Formats
INT4 / INT8 / NF4 / FP4 / FP8 behave differently. Same bits โ same error. NF4 is popular for weights because of its non-uniform codebook.
2๏ธโฃ Granularity
Per-tensor / per-channel / per-group. Smaller groups = less error but more scale metadata + kernel overhead. Outliers are the real enemy here.
3๏ธโฃ Algorithms
โข GPTQ โ second-order error minimisation
โข AWQ โ protects important channels using activation stats
โข SmoothQuant โ moves difficulty between activations & weights (great for W8A8)
4๏ธโฃ Training style
โข PTQ (post-training, most common)
โข QAT (quantisation-aware training)
โข QLoRA (frozen 4-bit base + trainable adapters)
5๏ธโฃ Real memory math (8B model example)
FP16 weights โ 16 GB
Packed INT4 + scales โ 4.125 GB
(KV cache and activations are separate โ often bigger than the weights on long contexts!)
6๏ธโฃ Storage โ compute
W4A16 doesnโt mean the matmul runs in 4-bit. Many kernels dequantise on the fly to FP16/BF16. Actual speedup depends on kernel quality, bandwidth, batch size and hardware.
7๏ธโฃ Always evaluate both quality AND serving
Task accuracy + TTFT + tokens/sec + peak VRAM under the same conditions. A 4-bit model is rarely 4ร faster.
๐ก Extra practical notes
โข KV cache quantisation (to 8-bit or lower) often saves more memory than going from 4-bit โ 3-bit weights.
โข Best results usually come from AWQ or GPTQ + good group size (128 is common).
โข Tools that make this easy: bitsandbytes, AutoAWQ, AutoGPTQ, llama.cpp (GGUF), and Hugging Faceโs quantisation pipelines.
โข On consumer GPUs / Apple Silicon, quantisation is what lets you run 7Bโ70B models locally at usable speeds.
Bottom line: quantisation is an engineering stack, not just a bit-width slider. Match the method to your hardware, context length and accuracy needs.
#LLM #Quantization #AI #LocalAI
LLM quantization reduces the precision used to represent model weights, activations and KV-cache tensors.
The goal is to reduce memory requirements and data movement while keeping numerical error within acceptable limits.
But bit width alone doesn't determine accuracy, memory consumption or inference speed.
There are several important engineering decisions.
1./ Quantization formats
INT4, INT8, NF4, FP4 and FP8 use different numerical representations.
Uniform integer quantization maps values through scales and, optionally, zero-points. Floating-point formats have exponent and fraction fields, while NF4 uses a nonuniform codebook.
The same bit width can produce different quantization errors.
2./ Scaling and granularity
Quantization can operate per tensor, per channel or per group.
Smaller groups can reduce reconstruction error, but require additional scaling metadata and compatible kernels.
Rounding and clipping introduce error. Outliers make this particularly important.
3./ Quantization algorithms
GPTQ: Uses approximate second-order information to reduce errors introduced by weight quantization.
AWQ: Uses activation statistics to identify salient weight channels and protect them during quantization.
SmoothQuant: Redistributes quantization difficulty between activations and weights to enable W8A8 quantization.
These methods address different aspects of the quantization problem.
4./ Training approaches
PTQ: Quantizes an already-trained model, often using calibration data.
QAT: Accounts for quantization effects during training, commonly using fake-quantization operations.
QLoRA: Keeps a quantized pretrained base model frozen while training low-rank adapters.
5./ Memory accounting
For a model with exactly 8 billion weights:
FP16 weights = 16 GB
Packed INT4 weights = 4 GB
One FP16 scale per 128 weights = 0.125 GB
Total = 4.125 GB for weights and scales, assuming no additional quantization metadata.
KV cache, activations and temporary buffers are separate memory costs.
6./ Storage versus computation
A W4A16 model uses 4-bit weights and 16-bit activations. That doesnt necessarily mean the matrix multiplication itself runs in 4-bit arithmetic.
Some kernels unpack and dequantize weight tiles before performing FP16/BF16 operations. Accumulation precision is another choice.
The actual speedup depends on kernel support, dequantization overhead, memory bandwidth, batch size and workload characteristics.
7./ Evaluation
Quantization needs to be evaluated for both model quality and serving performance.
Measure held-out task accuracy, numerical stability, time to first token, time per output token, throughput and peak memory under comparable conditions.
A 4-bit model isn't automatically four times faster than its 16-bit counterpart.
Quantization determines how values are represented. The hardware, kernels and workload determine how efficiently those values are processed.
Interviewer:
YOUR SERVICE HANDLES 50 REQUESTS/SEC FINE IN STAGING BUT FALLS OVER AT 80 REQUESTS/SEC IN PRODUCTION.
Average latency jumps from 40ms to 2+ seconds.
CPU stays under 25%. Memory and disk I/O look normal.
Whatโs causing the slowdown?
Interview question for AI/agent engineers:
Youโre building a support agent that can call tools to refund orders, resend receipts, and update shipping. A user says: โMy package never arrived, can you help?โ
How do you make sure the agent doesnโt quietly issue a refund the user never actually asked for even if someone later tampers with the system prompt or jailbreaks the conversation?
Short follow-ups:
1. Where do you enforce the โuser must explicitly request this actionโ rule โ inside the model, outside it, or both? Why?
2. How do you prevent a jailbroken or injected prompt from overriding that rule while still letting legitimate users get refunds when they clearly ask?
3. What concrete signals or checks would you require before any refund tool call is allowed?
What would you ask next?
Solid map shared by Kushal for AI infrastructure Engineering .
I would add these to the list๐
โข Profile workloads first , effective GPU use is often only 30-40% despite high nvidia-smi numbers.
โข Optimise KV cache (quantisation + better layouts) biggest lever for LLM latency and throughput.
โข Watch cost early: idle GPUs, zombies, and poor scheduling waste huge budgets.
โข Right-size and keep the stack modular so you can swap engines and models without pain.
AI Infrastructure Engineers (Step by Step)
01 | AI Infrastructure Fundamentals: What Runs AI? Compute โ GPU โ Memory โ Storage โ Network โ Cloud โ Kubernetes โ Containers โ Drivers โ CUDA
02 | AI Model Serving: How Do You Serve AI Models? Model โ Load โ Runtime โ API โ Batching โ Cache โ Stream โ Scale โ Route โ Serve
03 | GPU Infrastructure: How Do You Accelerate AI? GPU โ CUDA โ VRAM โ Tensor Cores โ Multi-GPU โ Parallelism โ NVLink โ NCCL โ Profiling โ Optimization
04 | LLM Inference: How Does AI Generate Responses? Prompt โ Tokens โ Prefill โ KV Cache โ Decode โ Sampling โ Batching โ Streaming โ Quantization โ Output
05 | AI Scaling: How Do You Handle AI Traffic? Replicas โ Load Balancing โ Autoscaling โ Batching โ Queues โ Caching โ Routing โ GPU Pooling โ Scheduling โ Failover
06 | AI Data Pipeline: How Does Data Reach AI Models? Collect โ Ingest โ Validate โ Clean โ Transform โ Chunk โ Embed โ Index โ Retrieve โ Feed
07 | AI Observability: How Do You Monitor AI Systems? Metrics โ Logs โ Traces โ GPU Usage โ Latency โ Throughput โ Token Usage โ Errors โ Alerts โ Dashboards
08 | AI Security: How Do You Secure AI Infrastructure? IAM โ Secrets โ Encryption โ Network Isolation โ Access Control โ Model Security โ Data Privacy โ Guardrails โ Auditing โ Compliance
09 | AI Platform Engineering: How Do You Build AI Platforms? Provision โ Configure โ Containerize โ Orchestrate โ Deploy โ Schedule โ Automate โ Monitor โ Govern โ Optimize
10 | AI Reliability & Cost: How Do You Run AI Efficiently? Capacity โ Utilization โ Benchmarking โ Right-Sizing โ Quantization โ Caching โ Spot GPUs โ Cost Tracking โ Fault Recovery โ Optimization
AI Security Engineering :
Chatbots are a commodity.
AI Security is the physics of trust.
Master these 12 stages and youโll never be unemployed again.
From threat modelling โ red teaming โ building the immune system for autonomous AI.
Bookmark this. The future needs defenders. ๐ก๏ธ
๐ค Made with AI
Useful + consistent beats loud every time. Solid growth advice from @techyoutbe.
Iโve built 100K audience across X, Substack, Telegram, Youtube, Threads and Gumroad by sharing practical tech knowledge.
Hereโs what Iโve learned about growing on X ๐
1. Build your positioning
โข Pick 2โ3 topics you know deeply
โข Make your bio clear
โข Give people a reason to follow you
โข Build a recognizable visual identity
2. Create content people save
โข Share roadmaps, cheat sheets, and visual guides
โข Use numbers, real examples, and practical takeaways
โข Focus on one idea per post
โข Make complex topics easy to understand
3. Make your content stand out
โข Share what you've actually learned or built
โข Turn technical knowledge into simple explanations
โข Have a clear point of view
โข Don't just repeat what everyone else is posting
4. Build a community
โข Engage with people in your niche
โข Reply with useful insights, not just โGreat post!โ
โข Learn from creators outside your niche
โข Be consistent before worrying about going viral
5. Turn attention into trust
โข Share your work publicly
โข Build useful resources
โข Give people something they can apply immediately
โข Let your content demonstrate your expertise
My biggest lesson?
You don't need to be the loudest person on X.
You need to be useful, recognizable, and consistent.
Iโm building Tech Fusionist around one simple idea:
Make Cloud, DevOps, AI, and Security easier to learn.
Share knowledge. Build in public. Help others grow.
Geeta retweeted
2015: AI will never replace developers.
2026: Developers asking AI how to stay employed. ๐ญ reality
Geeta retweeted
๐ How does Kubernetes run AI models and GPU workloads?
It's not just about deploying a model.
You need to manage GPU scheduling, autoscaling, multi-tenancy, inference traffic, workload isolation, security, and observability.
This visual guide breaks down 7 essential components of AI infrastructure on Kubernetes. ๐ค
Save this for your next AI / Cloud / DevOps deep dive.
โป๏ธ Repost to help other engineers learn.
Follow Tech Fusionist for more visual engineering guides.
Level up! ๐ฅ
Solve for x :
x^2 - 4x - 5 = 0
Factor it or use the quadratic formula โ your choice!
Drop your answer(s) in the comments ๐
#Algebra #Quadratic #MathChallenge #LevelUp
๐ค Made with AI
Geeta retweeted
REQUEST HEADERS IN API DESIGN
WHAT ARE HTTP REQUEST HEADERS?
Request headers provide additional information about an HTTP request sent from a client to a server.
โ Describe the request and its content
โ Specify the expected response format
โ Carry authentication credentials
โ Control caching behavior
โ Provide metadata about the client and request
Request headers help clients and servers communicate consistently.
CONTENT-TYPE HEADER
The Content-Type header specifies the format of the request body.
Examples:
โ Content-Type: application/json
โ Content-Type: application/xml
โ Content-Type: multipart/form-data
Use Cases:
โ Sending JSON data
โ Submitting XML documents
โ Uploading files using multipart forms
Content-Type tells the server how to interpret the request body.
ACCEPT HEADER
The Accept header specifies the response media types the client can process.
Examples:
โ Accept: application/json
โ Accept: application/xml
โ Accept: text/plain
Use Cases:
โ Requesting JSON responses
โ Requesting XML responses
โ Supporting different response formats
Accept helps the server select an appropriate response representation.
AUTHORIZATION HEADER
The Authorization header carries credentials used to authenticate a request.
Examples:
โ Authorization: Bearer
โ Authorization: Basic
Use Cases:
โ Authenticating API requests
โ Accessing protected resources
โ Passing access tokens to the server
Sensitive credentials should be transmitted over HTTPS.
CACHE-CONTROL HEADER
The Cache-Control header specifies caching directives for requests and responses.
Examples:
โ Cache-Control: no-cache
โ Cache-Control: no-store
โ Cache-Control: max-age=3600
Use Cases:
โ Controlling cached responses
โ Requiring cache revalidation
โ Preventing storage of sensitive responses
Correct caching policies improve performance and protect sensitive data.
USER-AGENT HEADER
The User-Agent header identifies the client software making the request.
Examples:
โ User-Agent: Mozilla/5.0
โ User-Agent: MyApp/1.0
โ User-Agent: MobileClient/2.1
Use Cases:
โ Identifying client applications
โ Troubleshooting compatibility issues
โ Analyzing client usage
Servers should not rely on User-Agent values for authentication or authorization.
ACCEPT-LANGUAGE HEADER
The Accept-Language header indicates the languages preferred by the client.
Examples:
โ Accept-Language: en
โ Accept-Language: en-US
โ Accept-Language: en-US,sw;q=0.9
Use Cases:
โ Returning localized messages
โ Supporting multilingual applications
โ Delivering language-specific content
This header helps APIs support international users.
IDEMPOTENCY-KEY HEADER
An Idempotency-Key header can help prevent duplicate operations when supported by an API.
Example:
โ Idempotency-Key: 7f3a9c2d-unique-key
Use Cases:
โ Processing payment requests
โ Preventing duplicate order creation
โ Safely retrying certain operations after network failures
The server must implement idempotency handling for the key to provide this protection.
IF-MATCH HEADER
The If-Match header makes a request conditional on the resource matching a specified entity tag (ETag).
Example:
โ If-Match: "version-123"
Use Cases:
โ Preventing conflicting updates
โ Implementing optimistic concurrency control
โ Ensuring a resource has not changed unexpectedly
If the condition fails, the server typically returns 412 Precondition Failed.
IF-NONE-MATCH HEADER
The If-None-Match header makes a request conditional on the resource not matching a specified ETag.
Example:
โ If-None-Match: "abc123"
Use Cases:
โ Validating cached resources
โ Reducing unnecessary data transfers
โ Checking whether a representation has changed
For a matching ETag in a typical GET request, the server can return 304 Not Modified.
CUSTOM REQUEST HEADERS
APIs may define custom headers for application-specific requirements.
Examples:
โ X-Request-ID: req-12345
โ X-Tenant-ID: tenant-001
โ X-Client-Version: 2.0.0
Use Cases:
โ Tracking requests across services
โ Identifying tenant context
โ Recording client application versions
Custom headers should be documented, consistently named, and validated by the server. Prefer standard headers when an established equivalent exists.
BEST PRACTICES FOR REQUEST HEADERS
Follow consistent rules when designing API headers.
โ Use standard HTTP headers whenever possible
โ Validate incoming header values
โ Use HTTPS to protect sensitive information
โ Never expose passwords or secrets in custom headers unnecessarily
โ Document required and optional headers
โ Return appropriate errors for invalid values
โ Avoid sending unnecessary headers
โ Apply authentication and authorization checks on the server
Well-designed request headers improve API security, interoperability, and maintainability.
BENEFITS OF PROPER REQUEST HEADER DESIGN
โ Improves communication between clients and servers
โ Supports secure authentication
โ Enables content negotiation
โ Helps manage caching efficiently
โ Simplifies debugging and request tracing
โ Improves consistency across API endpoints
Get the complete API Design ebook:
codewithdhanian.gumroad.com/โฆ
Geeta retweeted
30 End-to-End AI Product Architecture Designs to Master AI System Design:
โ AI Chatbot โ LLM + API + Conversation Memory
โก RAG System โ Documents + Embeddings + Vector Database
โข AI Coding Assistant โ LLM + Codebase Indexing + Developer Tools
โฃ AI Research Agent โ Search + Planning + Tool Calling
โค AI Customer Support Agent โ Knowledge Base + Ticketing + Escalation
โฅ AI SaaS Platform โ Authentication + LLM Gateway + Billing
โฆ AI Document Intelligence โ OCR + Extraction + Validation
โง AI Voice Assistant โ Speech-to-Text + LLM + Text-to-Speech
โจ AI Image Generation Platform โ Prompts + Diffusion Models + Storage
โฉ AI Video Generation Platform โ Generation Pipeline + GPU Workers
โช AI Recommendation Engine โ User Embeddings + Ranking + Feedback
โซ AI Search Engine โ Hybrid Search + Reranking + Semantic Retrieval
โฌ AI Fraud Detection System โ Feature Engineering + ML Inference
โญ AI Personalization Engine โ User Profiles + Context + Recommendations
โฎ AI Multi-Agent System โ Agent Orchestration + Shared State
โฏ AI Workflow Automation โ Triggers + Tools + Execution Engine
โฐ AI Knowledge Management System โ Ingestion + Indexing + RAG
โฑ AI Meeting Assistant โ Audio Processing + Transcription + Summarization
โฒ AI Email Assistant โ Classification + Generation + Approval
โณ AI Data Analyst โ Text-to-SQL + Query Execution + Visualization
ใ AI Financial Intelligence Platform โ Data Pipelines + Forecasting + Risk Analysis
ใ AI Healthcare Assistant โ Medical Knowledge + Guardrails + Human Oversight
ใ AI E-commerce Assistant โ Product Retrieval + Recommendations + Checkout Integration
ใ AI Learning Platform โ Adaptive Learning + Assessment + Progress Tracking
ใ AI Document Generation SaaS โ Templates + LLM + PDF Export
ใ AI Fine-Tuning Platform โ Dataset Preparation + Training + Model Registry
ใ AI Inference Platform โ Model Serving + Batching + GPU Scaling
ใ AI Observability Platform โ Tracing + Evaluation + Cost Monitoring
ใ AI Model Gateway โ Routing + Fallbacks + Rate Limiting
ใ Production-Grade AI Platform โ Microservices + Event Streaming + Caching + Security + MLOps
Master these architectures to understand how AI products move from prototypes to reliable, scalable, production-ready systems.
Grab the AI System Design Handbook:
codewithdhanian.gumroad.com/โฆ
Math + Dev life:
In math, we prove it.โจIn code, we assert itโฆ then comment out the assert when it fails in prod. ๐
Floating-point edition:โจ[ e^{i\pi} + 1 = 0 ]โจ(also known as โthe bug that only appears on Fridayโsโ).
๐ค Made with AI
Geeta retweeted
๐ฅ๐๐ ๐ฉ๐ฆ ๐๐๐๐ก๐ง๐๐ ๐ฅ๐๐ โ ๐ง๐๐ ๐๐๐๐๐๐ฅ๐๐ก๐๐ ๐ ๐๐ง๐ง๐๐ฅ๐ฆ
RAG is already powerful.
But what happens when your retrieval system can plan, use tools, remember context, and coordinate multiple agents?
Thatโs where Agentic RAG comes in.
๐๐ฒ๐โ๐ ๐ฏ๐ฟ๐ฒ๐ฎ๐ธ ๐ถ๐ ๐ฑ๐ผ๐๐ป:
01 โ ๐ง๐ฅ๐๐๐๐ง๐๐ข๐ก๐๐ ๐ฅ๐๐
The basic workflow looks like:
User Query
โ Embedding
โ Vector Database
โ Retrieve Relevant Information
โ Add Context
โ LLM
โ Answer
The goal is simple:
๐๐ถ๐๐ฒ ๐๐ต๐ฒ ๐๐๐ ๐ฏ๐ฒ๐๐๐ฒ๐ฟ ๐ถ๐ป๐ณ๐ผ๐ฟ๐บ๐ฎ๐๐ถ๐ผ๐ป ๐ฏ๐ฒ๐ณ๐ผ๐ฟ๐ฒ ๐ถ๐ ๐ฎ๐ป๐๐๐ฒ๐ฟ๐.
It works extremely well when the required information can be found through a predictable retrieval pipeline.
02 โ ๐๐๐๐ก๐ง๐๐ ๐ฅ๐๐
Agentic RAG adds an intelligent decision layer.
Instead of simply retrieving documents, an agent can:
โ Understand the goal
โ Plan the retrieval strategy
โ Decide which tools to use
โ Retrieve information
โ Evaluate what it found
โ Search again if necessary
โ Use memory and context
โ Produce the final result
The system becomes more adaptive.
03 โ ๐ ๐จ๐๐ง๐-๐๐๐๐ก๐ง ๐ฅ๐๐
Now take it one step further.
Different agents can handle different parts of the problem.
For example:
๐๐ด๐ฒ๐ป๐ ๐ญ โ Research
๐๐ด๐ฒ๐ป๐ ๐ฎ โ Search external sources
๐๐ด๐ฒ๐ป๐ ๐ฏ โ Analyze the retrieved information
๐๐ด๐ด๐ฟ๐ฒ๐ด๐ฎ๐๐ผ๐ฟ โ Combine everything
๐๐ฒ๐ป๐ฒ๐ฟ๐ฎ๐๐ถ๐๐ฒ ๐ ๐ผ๐ฑ๐ฒ๐น โ Produce the final answer
With memory, planning, MCP servers and multiple data sources, this can become a much more capable architecture.
๐ง๐๐ ๐ฆ๐๐ ๐ฃ๐๐ ๐๐๐๐๐๐ฅ๐๐ก๐๐:
๐ฅ๐๐
โ Retrieve information and generate an answer.
๐๐ด๐ฒ๐ป๐๐ถ๐ฐ ๐ฅ๐๐
โ Decide what to retrieve, use tools, reason over results and take actions.
๐ ๐๐น๐๐ถ-๐๐ด๐ฒ๐ป๐ ๐ฅ๐๐
โ Multiple specialized agents collaborate to solve the problem.
The future of enterprise AI won't just be about better models.
It will be about building systems that can ๐ฟ๐ฒ๐๐ฟ๐ถ๐ฒ๐๐ฒ, ๐ฟ๐ฒ๐ฎ๐๐ผ๐ป, ๐ฎ๐ฐ๐, ๐ฎ๐ป๐ฑ ๐ฐ๐ผ๐น๐น๐ฎ๐ฏ๐ผ๐ฟ๐ฎ๐๐ฒ.
Save this framework if you're learning or building with RAG and AI agents.
Follow @AamirAnsar94694 for more AI, tools, productivity and tech insights.
#AI #RAG #AgenticAI #AIAgents #GenerativeAI #MCP #ArtificialIntelligence























