AI Bytes Newsletter • Book in Progress এআই বাইটস নিউজলেটার • নতুন বই আসছে

Improve Your
Backend
& AI
Engineering Skills
আপনার
ব্যাকএন্ড
এবং এআই
ইঞ্জিনিয়ারিং স্কিল উন্নত করুন

JOIN 5,000+ SUBSCRIBERS ACCELERATING THEIR SKILLS EVERY WEEK প্রতি সপ্তাহে স্কিল বৃদ্ধি করা ৫,০০০+ সাবস্ক্রাইবারদের সাথে যোগ দিন

No spam, unsubscribe anytime কোনো স্প্যাম নয়, যেকোনো সময় আনসাবস্ক্রাইব করুন

One practical tip every Tuesday প্রতি মঙ্গলবার একটি প্র্যাক্টিক্যাল টিপ
Backend & AI deep dives ব্যাকএন্ড এবং এআই ডিপ-ডাইভ
Best practices and actionable advice বেস্ট প্র্যাক্টিস এবং অ্যাকশনেবল অ্যাডভাইস

Join thousands of software engineers হাজারো সফটওয়্যার ইঞ্জিনিয়ারের সাথে যুক্ত হোন

Pervez Hasan
Pervez Hasan AI Bytes Weekly
Issue #42
AI Bytes

4 Skills You Need as a Machine Learning Engineer মেশিন লার্নিং ইঞ্জিনিয়ার হিসেবে ৪টি অপরিহার্য স্কিল

By Pervez Hasan 5 min read

I spent a month at my first ML engineering job before I completed my first real production deployment. An entire month. আমার প্রথম এমএল চাকরিতে প্রথম প্রোডাকশন ডিপ্লয়মেন্ট শেষ করতে আমার পুরো এক মাস সময় লেগেছিল। একটি পুরো মাস।

Not because I was lazy. Not because I didn't know Python or PyTorch. But because nobody told me the critical engineering skills required for real production systems. কারণ আমি অলস ছিলাম তা নয়। বা পাইথন কিংবা PyTorch জানতাম না তাও নয়। কারণ কেউ আমাকে প্রোডাকশন সিস্টেমের জন্য সবচেয়ে গুরুত্বপূর্ণ স্কিলগুলোর কথা বলেনি।

There are 4 core engineering pillars that separate AI engineers who thrive in production from those who stay stuck in Jupyter notebooks: এমন ৪টি মূল স্কিল আছে যা প্রোডাকশন এআই ইঞ্জিনিয়ারদের সাধারণ জুপিটার নোটবুক কোডারদের থেকে আলাদা করে:

The 2026 Production Stack:
1. FastAPI + Async Inference Pipelines
2. Vector Databases & Hybrid RAG
3. Docker & Ubuntu Server Observability
4. Deterministic LLM Guardrails

1. Async APIs Over Blocking Calls ১. ব্লকিং কলের বদলে অ্যাসিঙ্ক এপিআই

When 200 users hit your model endpoint simultaneously, a synchronous Flask route will freeze your worker pool. Using FastAPI with async queues keeps latency predictable under heavy load. যখন ২০০ জন ইউজার একসাথে আপনার মডেল এন্ডপয়েন্টে রিকোয়েস্ট পাঠায়, তখন সাধারণ সিঙ্ক্রোনাস এপিআই আটকে যায়। FastAPI এবং অ্যাসিঙ্ক কিউ ব্যবহার করলে লোডের মধ্যেও ল্যাটেন্সি স্থিতিশীল থাকে।

# app/api/inference.py
@router.post("/predict")
async def run_model(req: Payload):
result = await queue.enqueue(req)
return {"status": "ok", "data": result}

2. Schema Validation with Pydantic ২. Pydantic দিয়ে স্কিমা ভ্যালিডেশন

Never trust raw LLM outputs. Wrap every agent response in strict Pydantic models and verification hooks so malformed JSON never crashes your downstream PostgreSQL or MongoDB database. কখনোই সরাসরি এলএলএম আউটপুটের ওপর ভরসা করবেন না। প্রতিটি এজেন্ট রেসপন্স Pydantic মডেল এবং স্টপ হুক দিয়ে যাচাই করুন যাতে ডাটাবেস ক্র্যাশ না করে।

3. Linux & Ubuntu Server Mastery ৩. লিনাক্স এবং উবুন্টু সার্ভার মাস্টারি

Today, we are breaking down the exact architecture behind scalable inference APIs, semantic caching, and how to host them reliably on Ubuntu servers with systemd and Docker. আজ আমরা স্কেলেবল ইনফারেন্স এপিআই, সিমান্টিক ক্যাশিং এবং ডকার ও উবুন্টু সার্ভারে সেগুলো নির্ভরযোগ্যভাবে হোস্ট করার সম্পূর্ণ আর্কিটেকচার নিয়ে আলোচনা করব।

Pro Tip: Always add a deterministic Stop Hook before allowing an AI agent to mark a deployment task complete. প্রো টিপ: এআই এজেন্ট কোনো টাস্ক শেষ করার আগে সবসময় একটি ডিটারমিনিস্টিক স্টপ হুক ব্যবহার করুন।

MASTER MODERN BACKEND & AI ENGINEERING TOOLS আধুনিক ব্যাকএন্ড এবং এআই ইঞ্জিনিয়ারিং টুলস আয়ত্ত করুন

Python
FastAPI
Pydantic
PostgreSQL
MongoDB
SQLAlchemy
Docker
Git
GitHub
Pytest
Postman
LangChain

WEEKLY ENGINEERING DISPATCH সাপ্তাহিক ইঞ্জিনিয়ারিং নিউজলেটার

Recent Issues Of AI Bytes সাম্প্রতিক এআই বাইটস আর্টিকেলসমূহ

VIDEO TUTORIALS & ARCHITECTURE BREAKDOWNS ভিডিও টিউটোরিয়াল এবং আর্কিটেকচার ব্রেকডাউন

Latest On YouTube ইউটিউবে সর্বশেষ ভিডিও

Calculus for Machine Learning (Bangla) | ML Math Explained Simply
1:16:46
ML Math

Calculus for Machine Learning (Bangla) | ML Math Explained Simply মেশিন লার্নিংয়ের জন্য ক্যালকুলাস (বাংলা) | এমএল ম্যাথ সহজ ভাষায়

Watch Video ভিডিও দেখুন YouTube
Production RAG Pipelines & Vector Search Architecture with FastAPI
48:20
AI Engineering

Production RAG Pipelines & Vector Search Architecture with FastAPI প্রোডাকশন RAG পাইপলাইন এবং FastAPI দিয়ে ভেক্টর সার্চ আর্কিটেকচার

Watch Video ভিডিও দেখুন YouTube
Clean Architecture FastAPI, PostgreSQL & Docker Deployment Guide
54:15
Backend Systems

Clean Architecture FastAPI, PostgreSQL & Docker Deployment Guide ক্লিন আর্কিটেকচার FastAPI, PostgreSQL এবং ডকার ডিপ্লয়মেন্ট গাইড

Watch Video ভিডিও দেখুন YouTube
Upcoming Book Release আসন্ন বই

The Ultimate AI Engineering Guide একটি সম্পূর্ণ এআই ইঞ্জিনিয়ারিং গাইড

I am actively writing a comprehensive hands-on book covering Machine Learning mathematics, Deep Neural Networks, and scalable FastAPI model deployment from scratch. আমি বর্তমানে মেশিন লার্নিং, ডিপ লার্নিং এবং স্কেলেবল ব্যাকএন্ড সিস্টেম আয়ত্ত করার একটি পূর্ণাঙ্গ গাইড লিখছি। আর্লি চ্যাপ্টার পেতে ওয়েটলিস্টে যোগ দিন।

Core ML Mathকোর এমএল অ্যালগরিদম

Deep Learningডিপ নিউরাল নেটওয়ার্ক

FastAPI Opsমডেল ডিপ্লয়মেন্ট

Practical Guide 2026 ED.

From Scratch to Production

The Ultimate AI Engineering Guide

ML Math • Deep Neural Networks • RAG & FastAPI Systems

Pervez Hasan
Backend & AI Agent Dev
Questions & Answers প্রশ্ন ও উত্তর

Frequently Asked Questions সচরাচর জিজ্ঞাসিত প্রশ্ন

Everything you need to know about the AI Bytes newsletter, source code templates, and the upcoming AI Engineering book. এআই বাইটস নিউজলেটার, সোর্স কোড টেমপ্লেট এবং আসন্ন বইটি নিয়ে আপনার সাধারণ জিজ্ঞাসার উত্তর।

Still have a question? আরও কোনো প্রশ্ন আছে?

Reach out directly for collaborations, backend architecture consulting, or newsletter inquiries. যেকোনো প্রশ্ন বা পরামর্শের জন্য সরাসরি ইমেইল করুন।

Contact Support সাপোর্টে যোগাযোগ করুন
It is tailored for students, backend developers, and aspiring ML Engineers who want to bridge the gap between theoretical math and production Python/FastAPI systems.যারা মেশিন লার্নিং, ব্যাকএন্ড এবং এআই নিয়ে ক্যারিয়ার গড়তে চান, এটি তাদের জন্য। থিওরি এবং প্রোডাকশন পাইথন কোডিং এর মধ্যে দারুণ সমন্বয় করা হয়েছে এখানে।
All practical examples, neural network architectures, and deployment scripts are written in Python using FastAPI, PyTorch, LangChain, Pydantic, Docker, and Ubuntu.সকল প্র্যাক্টিকাল উদাহরণ পাইথনে লেখা হয়েছে। আমরা মূলত FastAPI, PyTorch, LangChain, Pydantic, Docker এবং Ubuntu ব্যবহার করেছি।
Yes! Subscribers and book readers get access to GitHub repositories containing all datasets, Jupyter Notebooks, and production-ready FastAPI templates.হ্যাঁ! সাবস্ক্রাইবার এবং পাঠকরা গিটহাব রিপোজিটরির এক্সেস পাবেন, যেখানে সব ডেটাসেট এবং প্রোডাকশন-রেডি পাইথন কোড দেওয়া আছে।

I'm posting Backend and AI engineering content on multiple Social Media platforms. Reach out and let's connect. আমি বিভিন্ন সোশ্যাল মিডিয়া প্ল্যাটফর্মে ব্যাকএন্ড এবং এআই ইঞ্জিনিয়ারিং কন্টেন্ট শেয়ার করছি। যোগাযোগ করুন এবং চলুন কানেক্টেড থাকি।

Become a Better Backend & AI Engineer একজন দক্ষ ব্যাকএন্ড এবং এআই ইঞ্জিনিয়ার হয়ে উঠুন

Join 5,000+ engineers who are improving their skills every Tuesday morning. প্রতি মঙ্গলবার সকালে নিজেদের দক্ষতা বৃদ্ধি করা ৫,০০০+ ইঞ্জিনিয়ারদের সাথে যোগ দিন।

I'M PERVEZ আমি পারভেজ

I'm Pervez Hasan, a Backend & AI Agent Developer passionate about building scalable backend systems and intelligent AI agents. আমি পারভেজ , একজন ব্যাকএন্ড ও এআই এজেন্ট ডেভেলপার। স্কেলযোগ্য ব্যাকএন্ড সিস্টেম এবং বুদ্ধিমান এআই এজেন্ট তৈরি করতে ভালোবাসি।

Throughout my journey, I've faced challenges in learning backend engineering, working with APIs and databases, understanding the fundamentals of machine learning and deep learning, and exploring AI agents. I've spent countless hours reading documentation and learning from online resources. The journey hasn't always been easy. ব্যাকএন্ড ইঞ্জিনিয়ারিং, এপিআই ও ডেটাবেস নিয়ে কাজ করা, মেশিন লার্নিং ও ডিপ লার্নিংয়ের মৌলিক ধারণা শেখা এবং এআই এজেন্ট নিয়ে কাজ করার পথে অনেক চ্যালেঞ্জের মুখোমুখি হয়েছি। অসংখ্য ডকুমেন্টেশন পড়েছি এবং বিভিন্ন অনলাইন রিসোর্স থেকে শিখেছি। শেখার এই যাত্রা সব সময় সহজ ছিল না।

Over time, complex concepts gradually began to make sense. একসময় ধীরে ধীরে জটিল বিষয়গুলো বুঝতে শুরু করলাম।

Now, I share my learning experiences to help others learn, grow, and turn their ideas into reality. এখন, আমি আমার শেখার অভিজ্ঞতা ভাগ করে নিতে চাই, যেন অন্যরাও শিখতে পারে এবং নতুন কিছু তৈরি করতে পারে।

Pervez Hasan

I'm posting Backend and AI engineering content on multiple Social Media platforms. Reach out and let's connect. আমি বিভিন্ন সোশ্যাল মিডিয়া প্ল্যাটফর্মে ব্যাকএন্ড এবং এআই ইঞ্জিনিয়ারিং কন্টেন্ট শেয়ার করছি। যোগাযোগ করুন এবং চলুন কানেক্টেড থাকি।

AI Bytes Archive

Explore All Newsletter Issues সকল নিউজলেটার আর্টিকেল পড়ুন

Search and filter practical deep dives on AI Engineering, FastAPI, and Ubuntu servers. এআই ইঞ্জিনিয়ারিং, FastAPI এবং উবুন্টু সার্ভারের ওপর লেখা আর্টিকেলগুলো খুঁজুন।

AI Tools Best Practices

The Stop Hook That Won't Let LLMs Lie to You স্টপ হুক যা এলএলএম-কে মিথ্যা বলতে দেবে না

Pervez Hasan Pervez Hasan
12 min read

I've been building something new for backend engineers. আমি ব্যাকএন্ড ইঞ্জিনিয়ারদের জন্য নতুন কিছু তৈরি করছি।

It's designed to solve the "I don't know what I don't know" problem when working with AI agents in production environments. প্রোডাকশন এনভায়রনমেন্টে এআই এজেন্ট নিয়ে কাজ করার সময় যে সমস্যাগুলো তৈরি হয়, এটি তা সমাধানের জন্য ডিজাইন করা হয়েছে।

The Lie Problemমিথ্যা বলার সমস্যা

The LLM told me the work was done. The tests passed. Everything was green. It wasn't true. That was the moment I stopped trusting autonomous agent workflows to self-report their success. এলএলএম আমাকে বলেছিল কাজ শেষ। টেস্টগুলো পাস করেছে। সবকিছু ঠিকঠাক। কিন্তু তা সত্য ছিল না। তখনই আমি অটোনোমাস এজেন্টদের সফলতার রিপোর্টে বিশ্বাস করা বন্ধ করে দিই।

If you run agents in parallel, they hallucinate success states to satisfy the prompt constraints. We need a deterministic circuit breaker. Without one, an agent will confidently output "Deployment successful" while your server is actively crashing in the background. প্যারালাল এজেন্ট চালানোর সময়, তারা প্রম্পট মেলাতে সফলতার মিথ্যা চিত্র তৈরি করে। আমাদের একটি ডিটারমিনিস্টিক সার্কিট ব্রেকার প্রয়োজন। এটি না থাকলে, আপনার সার্ভার যখন ব্যাকগ্রাউন্ডে ক্র্যাশ করছে, তখনও এজেন্ট আত্মবিশ্বাসের সাথে বলবে "ডিপ্লয়মেন্ট সফল"।

I spent weeks debugging a multi-agent system where the coding agent was passing broken code to the testing agent, and the testing agent was simply returning "LGTM" (Looks Good To Me) because it was optimized to complete the conversation turn, not to actually run the bash commands. আমি একটি মাল্টি-এজেন্ট সিস্টেম ডিবাগ করতে কয়েক সপ্তাহ ব্যয় করেছি যেখানে কোডিং এজেন্ট টেস্টিং এজেন্টের কাছে ভুল কোড পাঠাচ্ছিল, আর টেস্টিং এজেন্ট শুধু "LGTM" বলে দিচ্ছিল। কারণ এটি শুধুমাত্র কনভারসেশন শেষ করার জন্য অপ্টিমাইজ করা ছিল, কমান্ড রান করার জন্য নয়।

Mathematical Formalizationগাণিতিক বিশ্লেষণ

Let's define why this happens mathematically. In autoregressive generation, the model selects tokens to maximize the conditional probability: আসুন দেখি গাণিতিকভাবে এটি কেন ঘটে। অটোরেগ্রেসিভ জেনারেশনের সময়, মডেল টোকেন নির্বাচন করে কন্ডিশনাল প্রবাবিলিটি ম্যাক্সিমাইজ করার জন্য:

$$ P(y_t | y_1, \dots, y_{t-1}, x) = \text{softmax}(W h_t) $$

Because the objective function $\mathcal{L} = - \sum y_i \log(\hat{y}_i)$ minimizes loss against the prompt, if the prompt says "Finish the task," the lowest loss path is often just stating "I am finished" rather than executing complex system calls. যেহেতু অবজেক্টিভ ফাংশন $\mathcal{L} = - \sum y_i \log(\hat{y}_i)$ প্রম্পটের সাপেক্ষে লস কমায়, প্রম্পটে "কাজ শেষ করো" বলা থাকলে, সবচেয়ে সহজ কাজ হলো "কাজ শেষ" বলে দেওয়া।

The model is literally doing math to figure out the path of least resistance. Generating 10 lines of complex unit tests has a higher probability of syntax errors (and thus higher internal perplexity) than generating a single token that says "Success". মডেল আক্ষরিক অর্থেই সবচেয়ে সহজ পথটি বের করার জন্য গণিত ব্যবহার করছে। ১০ লাইনের জটিল ইউনিট টেস্ট জেনারেট করার চেয়ে "Success" টোকেনটি তৈরি করা অনেক সহজ এবং এতে ভুল হওয়ার সম্ভাবনা কম থাকে।

System Architectureসিস্টেম আর্কিটেকচার

Agent Outputএজেন্ট আউটপুট

Generates solution

Stop Hookস্টপ হুক

Intercepts exit code

Verifierভেরিফায়ার

Runs unit tests

Layering a Verifier Modelএকটি ভেরিফায়ার মডেল লেয়ার করা

Sometimes standard deterministic unit tests are not enough. In these edge cases, we introduce a secondary, smaller LLM acting strictly as a judge. মাঝে মাঝে সাধারণ ডিটারমিনিস্টিক ইউনিট টেস্ট যথেষ্ট হয় না। এই ধরনের এজ কেসগুলোতে, আমরা একটি দ্বিতীয়, ছোট এলএলএম ব্যবহার করি যা কঠোরভাবে বিচারক হিসেবে কাজ করে।

This creates an Actor-Critic architecture. The Actor generates the code, and the Critic evaluates the output against the original constraints. The Critic is prompted to be exceptionally skeptical. It does not write code; its entire system prompt is dedicated to finding flaws. এটি একটি অ্যাক্টর-ক্রিটিক আর্কিটেকচার তৈরি করে। অ্যাক্টর কোড তৈরি করে এবং ক্রিটিক মূল শর্তগুলোর বিপরীতে আউটপুট মূল্যায়ন করে। ক্রিটিককে অতিরিক্ত সন্দেহপ্রবণ হওয়ার জন্য প্রম্পট করা হয়। এটি কোড লেখে না; এর সম্পূর্ণ কাজ হলো ভুল খুঁজে বের করা।

critic_prompt.py
def get_critic_prompt(original_task, agent_output):
    return f"""You are a strict and unforgiving code reviewer. 
Your ONLY job is to find flaws in the following output.
Did the agent completely solve this task without hallucinating?

Original Task: {original_task}
Agent Output: {agent_output}

You must not assume anything works unless proven.
Respond ONLY with a JSON object containing 'pass' (boolean) 
and 'reason' (string explaining the failure if false)."""

The Pattern in Practiceপ্র্যাক্টিক্যালে এর ব্যবহার

The mechanism is simple. If your hook always returns the decision "block", the agent will keep looping. Here is the Bash implementation that prevents premature completion: পদ্ধতিটি সহজ। যদি আপনার হুক সবসময় "block" রিটার্ন করে, তবে এজেন্ট লুপ করতে থাকবে। নিচে এর ব্যাশ ইমপ্লিমেন্টেশন দেওয়া হলো:

verify_hook.sh
#!/bin/bash

# infinite loop guard
if [ "$(echo "$event" | jq -r '.stop_hook_action')" = "true" ]; then
    exit 0
fi

if npm test > /dev/null 2>&1; then
    exit 0
else
    jq -n '{decision: "block", reason: "npm test failed."}'
    exit 1
fi

One Caveatএকটি সতর্কতা

Stop hooks can deadlock. If your verifier produces false positives, it will block the AI infinitely. Ensure your tests are completely deterministic. স্টপ হুকে ডেডলক হতে পারে। ভেরিফায়ার ভুল করলে এআই অনন্তকাল আটকে থাকতে পারে। তাই আপনার টেস্টগুলো শতভাগ সঠিক হওয়া জরুরি।

The official documentation actually has a section called "Stop hook runs forever." If your hook always returns decision "block", Claude is forced to keep trying infinitely. This is why you must implement a max-retry counter in your orchestrator, or rely on token-limit timeouts. অফিসিয়াল ডকুমেন্টেশনে "Stop hook runs forever" নামে একটি সেকশন আছে। যদি আপনার হুক সবসময় "block" রিটার্ন করে, মডেলটি বারবার চেষ্টা করতে বাধ্য হয়। এই কারণেই আপনার অর্কেস্ট্রেটরে ম্যাক্স-রিট্রাই কাউন্টার রাখা উচিত।

The Bigger Pictureসামগ্রিক চিত্র

The lesson is small but it generalizes. Agents shouldn't be trusted to grade themselves. শিক্ষাটি ছোট হলেও এটি ব্যাপকভাবে প্রযোজ্য। এজেন্টদের নিজেদের কাজের মূল্যায়ন করতে দেওয়া উচিত নয়।

The Stop hook is just a clean place in the AI architecture to insert a second opinion. One that runs on deterministic logic, or a cheaper model trained to be skeptical rather than agreeable. One that you control with a single block of code. স্টপ হুক হলো এআই আর্কিটেকচারের এমন একটি জায়গা যেখানে আপনি দ্বিতীয় কোনো মতামত যুক্ত করতে পারেন। এমন কিছু যা ডিটারমিনিস্টিক লজিকে চলে, বা এমন একটি মডেল যা একমত হওয়ার চেয়ে সন্দেহ করতে বেশি অভ্যস্ত।

This is where AI engineering is actually heading in 2026. Not bigger models. Better scaffolding around them. The models are becoming commodities. The scaffolding is becoming the product. ২০২৬ সালে এআই ইঞ্জিনিয়ারিং আসলে এদিকেই এগোচ্ছে। আরও বড় মডেল নয়, বরং সেগুলোর চারপাশে আরও ভালো স্ক্যাফোল্ডিং বা কাঠামো তৈরি করা। মডেলগুলো এখন সাধারণ পণ্যে পরিণত হচ্ছে, আর কাঠামো হয়ে উঠছে আসল প্রোডাক্ট।

Wire up a Stop hook this week. Watch what happens the next time your LLM tries to tell you the work is done. It won't get to lie to you again. এই সপ্তাহে একটি স্টপ হুক যুক্ত করে দেখুন। পরের বার যখন আপনার এলএলএম বলবে কাজ শেষ, তখন খেয়াল করুন কী ঘটে। এটি আপনাকে আর মিথ্যা বলতে পারবে না।

Until next time,পরবর্তী সময় পর্যন্ত,
Cheers friends.ধন্যবাদ সবাইকে।

Pervez Hasan

Pervez Hasan

Find me online:

More from AI Bytesআরও পড়ুন