<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Sumanta Swain</title>
    <description>The latest articles on Forem by Sumanta Swain (@sumanta01).</description>
    <link>https://forem.com/sumanta01</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3486869%2F2a75eac0-c5be-49cc-8b7f-327dacf1e599.jpg</url>
      <title>Forem: Sumanta Swain</title>
      <link>https://forem.com/sumanta01</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/sumanta01"/>
    <language>en</language>
    <item>
      <title>Build a High-Performance RAG System with Gemini 2.5 Flash and FAISS 🚀</title>
      <dc:creator>Sumanta Swain</dc:creator>
      <pubDate>Mon, 16 Feb 2026 18:23:17 +0000</pubDate>
      <link>https://forem.com/sumanta01/build-a-high-performance-rag-system-with-gemini-25-flash-and-faiss-3d1i</link>
      <guid>https://forem.com/sumanta01/build-a-high-performance-rag-system-with-gemini-25-flash-and-faiss-3d1i</guid>
      <description>&lt;p&gt;Retrieval-Augmented Generation (RAG) is the gold standard for reducing LLM hallucinations and giving AI access to your private data. While there are many frameworks out there, building one from scratch gives you full control over the pipeline.&lt;/p&gt;

&lt;p&gt;In this post, I’ll show you how to build a complete RAG system using Google’s Gemini API for embeddings and text generation, and FAISS for lightning-fast vector similarity search.&lt;/p&gt;

&lt;h2&gt;
  
  
  🏗️ The Tech Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;LLM&lt;/strong&gt;: Gemini 2.5 Flash (Fast, cost-effective, and powerful)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Embeddings&lt;/strong&gt;: gemini-embedding-001&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vector Database&lt;/strong&gt;: FAISS (Facebook AI Similarity Search)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Environment&lt;/strong&gt;: Python 3.13+ with the &lt;strong&gt;uv&lt;/strong&gt; package manager.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🛠️ How it Works: The Architecture
&lt;/h2&gt;

&lt;p&gt;The system follows a three-step process:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Ingestion&lt;/strong&gt;: We read .txt files, convert them into high-dimensional vectors using Gemini, and store them in a FAISS index.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Retrieval&lt;/strong&gt;: When a user asks a question, we embed the query and find the most relevant document chunks using Cosine Similarity.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Generation&lt;/strong&gt;: We feed the retrieved context + the original question into Gemini 2.5 Flash to generate a grounded, cited answer.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rag-implementation-gemini/
├── docs/                    # Place your .txt documents here
│   ├── doc1.txt            # Sample AI/ML content
│   └── doc2.txt            # Sample RAG content
├── main.py                 # Main application entry point
├── ingest_docs.py          # Document ingestion and embedding
├── rag_query.py            # Query processing and answer generation
├── test_rag.py             # Automated test suite
├── pyproject.toml          # Project dependencies
├── README.md               # This file
├── faiss_index.bin         # Generated FAISS index (after ingestion)
└── docs_meta.pkl           # Generated document metadata (after ingestion)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🚀 Getting Started
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Setup&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;First, ensure you have your Google API Key from Google AI Studio.&lt;/p&gt;

&lt;p&gt;I use the uv package manager for its incredible speed. If you haven't tried it yet, it’s a game-changer for Python workflows.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Install dependencies
uv sync

# Set your API Key
export GOOGLE_API_KEY="your_api_key_here"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Document Ingestion (ingest_docs.py)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We use IndexFlatIP (Inner Product) on normalized vectors to perform Cosine Similarity. This ensures that even if the document lengths vary, the semantic relevance remains accurate.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import os
import pickle
from glob import glob
import numpy as np
import faiss
from dotenv import load_dotenv
from google import genai

load_dotenv()
API_KEY = os.environ.get("GEMINI_API_KEY")
if not API_KEY:
    raise SystemExit("Set GEMINI_API_KEY in .env or environment")

# initialize client (per Gemini docs)
client = genai.Client(api_key=API_KEY)

# choose the Gemini embedding model (example name; docs use gemini-embedding-001).
EMBED_MODEL = "gemini-embedding-001"

DOCS_DIR = "docs"
INDEX_FILE = "faiss_index.bin"
META_FILE = "docs_meta.pkl"

def read_documents(path):
    files = glob(os.path.join(path, "*.txt"))
    docs = []
    for p in files:
        with open(p, "r", encoding="utf-8") as f:
            text = f.read().strip()
        docs.append({"path": p, "text": text})
    return docs

def embed_texts(texts):
    # Call Gemini embeddings endpoint and normalize output to list of float vectors
    resp = client.models.embed_content(model=EMBED_MODEL, contents=texts)
    vectors = []
    for emb in resp.embeddings:
        # SDKs often return ContentEmbedding with `.values`; fallback to iterable
        if hasattr(emb, "values"):
            vec = np.array(emb.values, dtype="float32")
        else:
            vec = np.array(list(emb), dtype="float32")
        vectors.append(vec)
    return np.vstack(vectors)

def build_faiss_index(embs):
    dim = embs.shape[1]
    index = faiss.IndexFlatIP(dim)  # use inner product on normalized vectors (cosine)
    # Normalize if using IP for cosine:
    faiss.normalize_L2(embs)
    index.add(embs)
    return index

def main():
    docs = read_documents(DOCS_DIR)
    texts = [d["text"] for d in docs]
    if not texts:
        print("No docs found in", DOCS_DIR)
        return

    print(f"Embedding {len(texts)} docs with model {EMBED_MODEL} ...")
    embs = embed_texts(texts)  # shape: (N, dim)

    print("Building FAISS index...")
    index = build_faiss_index(embs)

    print("Saving index and metadata...")
    faiss.write_index(index, INDEX_FILE)
    with open(META_FILE, "wb") as f:
        pickle.dump(docs, f)

    print("Done. Index saved to", INDEX_FILE)

if __name__ == "__main__":
    main()

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. The Retrieval &amp;amp; Query Engine (rag_query.py)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The magic happens when we combine the retrieved snippets into a single prompt. We instruct the model to be a "helpful assistant" and, crucially, to cite its sources.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import os
import pickle
import numpy as np
import faiss
from dotenv import load_dotenv
from google import genai

load_dotenv()
# Support both GOOGLE_API_KEY and GEMINI_API_KEY for convenience
API_KEY = os.environ.get("GOOGLE_API_KEY") or os.environ.get("GEMINI_API_KEY")
if not API_KEY:
    raise SystemExit("Set GOOGLE_API_KEY or GEMINI_API_KEY in .env or environment")

client = genai.Client(api_key=API_KEY)
EMBED_MODEL = "gemini-embedding-001"
GEN_MODEL = "gemini-2.5-flash"   # example text generation model; pick one available to you

INDEX_FILE = "faiss_index.bin"
META_FILE = "docs_meta.pkl"

def embed_query(q):
    resp = client.models.embed_content(model=EMBED_MODEL, contents=[q])
    # extract the actual embedding values from ContentEmbedding object
    if hasattr(resp.embeddings[0], 'values'):
        vec = np.array(resp.embeddings[0].values, dtype="float32")
    else:
        # fallback if structure is different
        vec = np.array(list(resp.embeddings[0]), dtype="float32")
    # normalize for cosine (since index used normalized vectors)
    faiss.normalize_L2(vec.reshape(1, -1))
    return vec

def load_index():
    if not os.path.exists(INDEX_FILE) or not os.path.exists(META_FILE):
        raise SystemExit("Run ingest_docs.py first to build index.")
    index = faiss.read_index(INDEX_FILE)
    with open(META_FILE, "rb") as f:
        docs = pickle.load(f)
    return index, docs

def retrieve_topk(index, qvec, k=3):
    # qvec shape (dim,)
    q = qvec.reshape(1, -1)
    faiss.normalize_L2(q)  # ensure normalized
    scores, ids = index.search(q, k)
    return scores[0], ids[0]

def generate_answer(query, retrieved_texts):
    # Build a prompt that includes retrieved docs as context (short)
    context = "\n\n---\n\n".join(retrieved_texts)
    prompt = (
        "You are a helpful assistant. Use the following context to answer the question.\n\n"
        f"CONTEXT:\n{context}\n\nQUESTION:\n{query}\n\nAnswer concisely and cite which context file you used."
    )

    # call Gemini text generation (per docs)
    response = client.models.generate_content(
        model=GEN_MODEL,
        contents=prompt
    )
    # many SDKs have response.text or response.output; check your SDK return structure
    answer = getattr(response, "text", None) or response.output[0].content[0].text
    return answer

def main():
    index, docs = load_index()
    question = input("Enter your question: ").strip()
    qvec = embed_query(question)
    scores, ids = retrieve_topk(index, qvec, k=3)

    retrieved_texts = []
    for idx in ids:
        if idx &amp;lt; 0 or idx &amp;gt;= len(docs): 
            continue
        meta = docs[idx]
        retrieved_texts.append(f"FILE: {meta['path']}\n{meta['text'][:1000]}")  # limited preview

    print("\nRetrieved top documents (score, path):")
    for s, i in zip(scores, ids):
        if i &amp;gt;= 0 and i &amp;lt; len(docs):
            print(f"{s:.4f}  {docs[i]['path']}")

    print("\nGenerating answer using Gemini...")
    answer = generate_answer(question, retrieved_texts)
    print("\n=== Answer ===\n")
    print(answer)

if __name__ == "__main__":
    main()

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🖥️ User Experience: The Interactive CLI
&lt;/h2&gt;

&lt;p&gt;I built an interactive menu to make the system easy to use. You can toggle between ingesting new knowledge and asking questions instantly.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;=== RAG with Gemini ===
1. Ingest documents
2. Ask a question
0. Exit

Enter your choice: 2
Enter your question: How does this RAG system handle vector search?

Retrieved top documents (score, path):
0.8921  docs/technical_specs.txt

Generating answer using Gemini...
=== Answer ===
This system utilizes FAISS with IndexFlatIP for similarity search. 
It normalizes embeddings to perform Cosine Similarity... [FILE: docs/technical_specs.txt]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  💡 Why this approach?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Gemini 2.5 Flash&lt;/strong&gt;: It offers a massive context window and rapid response times, making the "Generation" phase feel instantaneous.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;FAISS&lt;/strong&gt;: Instead of relying on a heavy cloud database for small-to-medium projects, FAISS is local, incredibly fast, and easy to deploy.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Transparency&lt;/strong&gt;: By including Source Citations, we eliminate the "black box" feel of AI. The user knows exactly which document provided the answer.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🔧 Future Improvements
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Chunking Strategy&lt;/strong&gt;: Implement recursive character splitting for larger documents.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;PDF Support&lt;/strong&gt;: Add PyPDF2 or langchain loaders to handle more file types.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Web UI&lt;/strong&gt;: Wrap this in Streamlit for a more modern interface.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🔗 Explore the Code
&lt;/h2&gt;

&lt;p&gt;The full implementation is available on my GitHub: &lt;/p&gt;

&lt;p&gt;(&lt;a href="https://github.com/SumantaSwainEpam/rag-implementation-gemini" rel="noopener noreferrer"&gt;https://github.com/SumantaSwainEpam/rag-implementation-gemini&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;I’d love to hear your thoughts! How are you handling document retrieval in your projects? Let’s discuss in the comments! 👇&lt;/p&gt;

</description>
      <category>rag</category>
      <category>llm</category>
      <category>ai</category>
      <category>python</category>
    </item>
    <item>
      <title>The Death of Brittle Scripts: Architecting a Self-Healing AI Automation Ecosystem</title>
      <dc:creator>Sumanta Swain</dc:creator>
      <pubDate>Mon, 15 Dec 2025 18:04:46 +0000</pubDate>
      <link>https://forem.com/sumanta01/the-death-of-brittle-scripts-architecting-a-self-healing-ai-automation-ecosystem-2d73</link>
      <guid>https://forem.com/sumanta01/the-death-of-brittle-scripts-architecting-a-self-healing-ai-automation-ecosystem-2d73</guid>
      <description>&lt;h2&gt;
  
  
  The "Monday Morning" Nightmare
&lt;/h2&gt;

&lt;p&gt;Every SDET knows the feeling. You walk in on Monday morning, check the Jenkins pipeline, and see a sea of red.&lt;/p&gt;

&lt;p&gt;Did the backend fail? No.&lt;br&gt;
Did the database crash? No.&lt;br&gt;
&lt;strong&gt;A frontend developer changed the ID of the "Submit" button from #submit-btn to #btn-submit-v2.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Traditional automation frameworks (Selenium, Cypress, Playwright) are &lt;strong&gt;imperative&lt;/strong&gt;. They do exactly what they are told. If you tell them to find #submit-btn and it’s gone, they panic and crash. They lack &lt;strong&gt;Context.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We need to stop writing scripts that follow instructions and start architecting systems that understand &lt;strong&gt;Intent&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Evolution: From SDET to AI Automation Architect
&lt;/h2&gt;

&lt;p&gt;The industry is shifting. We are moving away from writing thousands of lines of boilerplate Java/Python code to manage page objects. The new role is the &lt;strong&gt;AI Automation Architect&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The goal? Build a centralized "Neuro-Engine" that handles the logic, while the scripts only define the goal.&lt;/p&gt;

&lt;p&gt;Below is the architecture of "&lt;strong&gt;NeuroMate&lt;/strong&gt;", a next-generation, self-healing automation ecosystem.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcv2id8aaycdf6uklhmfq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcv2id8aaycdf6uklhmfq.png" alt=" " width="800" height="632"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Decoding the Architecture
&lt;/h2&gt;

&lt;p&gt;Let’s break down the diagram into its core zones to understand why this approach changes the game.&lt;/p&gt;

&lt;h1&gt;
  
  
  1. Zone A &amp;amp; B: The Polyglot Bridge (gRPC) 🌉
&lt;/h1&gt;

&lt;p&gt;In a large enterprise, the Backend team might use Java, the Data team uses Python, and the Frontend team uses TypeScript. Forcing everyone to write tests in one language is a bottleneck.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Solution:&lt;/strong&gt; Decouple the "Test Definition" from the "Test Execution."&lt;/p&gt;

&lt;p&gt;By using gRPC and Protocol Buffers, we create a universal contract. A QA Engineer can define a test intent in Java, Python, or C#. That intent is serialized and sent to the core engine. The test runner doesn't care about the language; it cares about the data.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Zone C: The Cognitive Core (The Brain) 🧠
&lt;/h2&gt;

&lt;p&gt;This is where the magic happens. Standard frameworks use logic (If X then Y). This architecture uses Agents.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Planner Agent:&lt;/strong&gt; Instead of hardcoding steps, we give the agent a goal: "Buy the Red Shoes." The agent uses an LLM to look at the current page state and determine the 3 necessary steps to achieve that goal.&lt;br&gt;
&lt;strong&gt;The DOM Analyzer:&lt;/strong&gt; It parses the HTML not as text, but as a semantic tree, understanding that a "Magnifying Glass" icon usually means "Search," regardless of the class name.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Zone E: Hybrid Execution (Modern + Legacy) 🎭
&lt;/h2&gt;

&lt;p&gt;We cannot just abandon legacy systems. A robust architecture must support both.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Playwright:&lt;/strong&gt; Used for modern, high-speed execution on React/Vue apps.&lt;br&gt;
&lt;strong&gt;Selenium:&lt;/strong&gt; Kept for compatibility with legacy enterprise apps.&lt;br&gt;
&lt;strong&gt;Appium:&lt;/strong&gt; For mobile coverage.&lt;/p&gt;

&lt;p&gt;The Core Engine decides which driver to use based on the target application, abstracting this complexity away from the user.&lt;/p&gt;

&lt;h2&gt;
  
  
  The "Secret Sauce": Visual Self-Healing ❤️‍🩹
&lt;/h2&gt;

&lt;p&gt;The most critical part of this diagram is the Feedback Loop at the bottom.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Scenario:&lt;/strong&gt;&lt;br&gt;
The script tries to click the "Pay Now" button using XPath //div[&lt;a class="mentioned-user" href="https://dev.to/id"&gt;@id&lt;/a&gt;='pay'].&lt;br&gt;
The app updates, and the ID is removed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Standard Framework:&lt;/strong&gt; NoSuchElementException. Crash. ❌&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NeuroMate Framework:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Error Detection:&lt;/strong&gt; The DOMParser catches the failure.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Healer Agent Activation:&lt;/strong&gt; The system triggers the Self-Healing Agent.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vision Lookup:&lt;/strong&gt; The agent takes a screenshot of the page. It uses a Vision Model (like YOLO or CLIP) to find the element that visually looks like a "Pay Now" button near the "Total Price" text.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Auto-Patching:&lt;/strong&gt; It clicks the button. If successful, it updates the Vector Database (Zone D) with the new selector.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The next time this test runs, it uses the new selector automatically. Zero human intervention required.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Tech Stack
&lt;/h2&gt;

&lt;p&gt;If you want to build this today, here is the recommended stack:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Orchestration:&lt;/strong&gt; LangChain or LangGraph (Python)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API Layer:&lt;/strong&gt; FastAPI with gRPC&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vision:&lt;/strong&gt; OpenAI GPT-4o (Vision) or local YOLOv8&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory:&lt;/strong&gt; Qdrant or Weaviate (Vector DB)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Execution:&lt;/strong&gt; Playwright Python&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The future of QA isn't about writing better selectors; it's about eliminating the need for them entirely.&lt;/p&gt;

&lt;p&gt;By adopting an &lt;strong&gt;AI Automation Architecture&lt;/strong&gt;, we shift from being "Script Maintainers" to being "System Architects," building resilient platforms that adapt as fast as the software they test.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>automation</category>
      <category>systemdesign</category>
      <category>python</category>
    </item>
    <item>
      <title>Unpopular Opinion: The Death of Prompt Engineering (Enter DSPy)</title>
      <dc:creator>Sumanta Swain</dc:creator>
      <pubDate>Mon, 08 Dec 2025 18:51:56 +0000</pubDate>
      <link>https://forem.com/sumanta01/unpopular-opinion-the-death-of-prompt-engineering-enter-dspy-2lkn</link>
      <guid>https://forem.com/sumanta01/unpopular-opinion-the-death-of-prompt-engineering-enter-dspy-2lkn</guid>
      <description>&lt;p&gt;The Problem with "&lt;strong&gt;Prompt Engineering&lt;/strong&gt;" &lt;br&gt;
We need to be honest with ourselves. "Prompt Engineering" as we know it today is not really engineering.&lt;/p&gt;

&lt;p&gt;Spending 4 hours tweaking a string from &lt;strong&gt;"You are a helpful assistant"&lt;/strong&gt; to &lt;strong&gt;"You are an expert professor"&lt;/strong&gt; just to get a JSON output is not scalable. It's guessing. It is brittle. And if you change the underlying LLM (e.g., from &lt;em&gt;GPT-4&lt;/em&gt; to &lt;em&gt;Claude 3&lt;/em&gt;), you often have to rewrite all your prompts.&lt;/p&gt;

&lt;p&gt;The industry is shifting. We are moving from &lt;strong&gt;Hand-Crafted Strings&lt;/strong&gt; to &lt;strong&gt;Compiled Logic&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Enter DSPy (Declarative Self-improving Python)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Developed by Stanford NLP, DSPy is a framework that treats language models like a compiler treats machine code.&lt;/p&gt;

&lt;p&gt;Instead of writing prompts, you define &lt;strong&gt;Signatures&lt;/strong&gt; (Inputs and Outputs).&lt;br&gt;
Instead of manual tweaking, you use a &lt;strong&gt;Teleprompter&lt;/strong&gt; (Optimizer) that automatically figures out the best prompt for your specific data.&lt;/p&gt;

&lt;p&gt;It is the PyTorch of LLMs. You define the architecture (the logic), and DSPy optimizes the &lt;em&gt;parameters&lt;/em&gt; (the prompts).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Show Me The Code&lt;/strong&gt;&lt;br&gt;
Here is a simple example. Notice that I never once write a string like &lt;em&gt;"Please be helpful"&lt;/em&gt; or &lt;em&gt;"Think step by step."&lt;/em&gt; DSPy handles that optimization for me.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fflmt5i1f3ktdekawrind.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fflmt5i1f3ktdekawrind.png" alt=" " width="800" height="712"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Output&lt;/strong&gt;&lt;br&gt;
When you run this, DSPy automatically injects a &lt;em&gt;"Reasoning"&lt;/em&gt; step (Chain of Thought) because we used the dspy.ChainOfThought module. We didn't have to beg the LLM to &lt;em&gt;"think step by step."&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Output
Prediction Object: Prediction(
   reasoning='The capital of India is New Delhi.',
   answer='New Delhi'
)
Reasoning: The capital of India is New Delhi.
Answer: New Delhi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why This Matters&lt;/strong&gt;&lt;br&gt;
If you are building production AI applications, you cannot rely on brittle string templates.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Modularity:&lt;/strong&gt; You can swap GPT-4 for Llama-3, and DSPy can re-optimize the prompts automatically.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Optimization:&lt;/strong&gt; DSPy can actually learn from your data. If you give it 10 examples of good answers, it will rewrite its own prompts to maximize accuracy.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Clean Code:&lt;/strong&gt; Your Python code looks like Python, not a wall of text.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Prompt Engineering isn't dead, but &lt;strong&gt;Manual&lt;/strong&gt; Prompt Engineering is on its way out. It's time to start compiling.&lt;/p&gt;

</description>
      <category>python</category>
      <category>ai</category>
      <category>machinelearning</category>
      <category>llm</category>
    </item>
    <item>
      <title>Cursor vs Antigravity-The IDE Fight Nobody Asked For, But We Needed😂</title>
      <dc:creator>Sumanta Swain</dc:creator>
      <pubDate>Thu, 27 Nov 2025 19:21:25 +0000</pubDate>
      <link>https://forem.com/sumanta01/cursor-vs-antigravity-the-ide-fight-nobody-asked-for-but-we-needed-p26</link>
      <guid>https://forem.com/sumanta01/cursor-vs-antigravity-the-ide-fight-nobody-asked-for-but-we-needed-p26</guid>
      <description>&lt;p&gt;🧠 &lt;strong&gt;1. AI Coding Intelligence&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cursor:&lt;/strong&gt;&lt;br&gt;
 🔥 Deep code understanding&lt;br&gt;
 🧩 Great for debugging &amp;amp; refactoring&lt;br&gt;
 📚 Best for large legacy projects&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Antigravity:&lt;/strong&gt;&lt;br&gt;
 ⚡ Ultra-fast code generation&lt;br&gt;
 🪄 Insane auto-completion accuracy&lt;br&gt;
 💡 Predicts what you’ll code next 😅&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Winner:&lt;/strong&gt; Tie — depends on your style!&lt;/p&gt;

&lt;p&gt;🎨 &lt;strong&gt;2. Developer Experience (DX)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cursor:&lt;/strong&gt;&lt;br&gt;
 🧼 Clean UI&lt;br&gt;
 📦 Git-friendly&lt;br&gt;
 🗺️ Project navigation feels natural&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Antigravity:&lt;/strong&gt;&lt;br&gt;
 🌌 Futuristic UI&lt;br&gt;
 🕹️ Sidebar dashboards&lt;br&gt;
 🎚️ Customizable everything&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Winner:&lt;/strong&gt; Antigravity (the UI is next-level)&lt;/p&gt;

&lt;p&gt;🤖 &lt;strong&gt;3. AI Pair-Programming&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cursor:&lt;/strong&gt;&lt;br&gt;
 👨‍🏫 More like a senior engineer guiding you&lt;br&gt;
 📝 Writes cleaner, safer code&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Antigravity:&lt;/strong&gt;&lt;br&gt;
 🧑‍🚀 More like a hyperactive junior dev&lt;br&gt;
 ⚡ Generates LOT of code very fast&lt;br&gt;
 😅 Sometimes too enthusiastic&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Winner:&lt;/strong&gt; Cursor (for stability), Antigravity (for speed)&lt;/p&gt;

&lt;p&gt;🧪 &lt;strong&gt;4. Test Automation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cursor:&lt;/strong&gt;&lt;br&gt;
 🛠️ Creates better test structures&lt;br&gt;
 🔍 Understands contexts deeply&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Antigravity:&lt;/strong&gt;&lt;br&gt;
 🧬 Great at generating boilerplate&lt;br&gt;
 ⏱️ Faster test case creation&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Winner:&lt;/strong&gt; Cursor for quality, Antigravity for speed&lt;/p&gt;

&lt;p&gt;🎯 &lt;strong&gt;5. Real-World Productivity&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cursor:&lt;/strong&gt;&lt;br&gt;
 🎯 Better for complex enterprise apps&lt;br&gt;
 👨‍💻 Perfect for refactoring, debugging, testing&lt;br&gt;
 🤝 Works well with existing workflows&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Antigravity&lt;/strong&gt;&lt;br&gt;
 🚀 Perfect for building MVPs &amp;amp; prototypes&lt;br&gt;
 🎨 Creative coding, quick scaffolds&lt;br&gt;
 🧪 Experimentation heaven&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Winner:&lt;/strong&gt; Depends on your project.&lt;/p&gt;

&lt;p&gt;🏆 &lt;strong&gt;Final Verdict (My Personal Take)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Building large/enterprise projects? → Cursor&lt;/li&gt;
&lt;li&gt; Building fast prototypes / MVPs? → Antigravity&lt;/li&gt;
&lt;li&gt; Want clean stable code? → Cursor&lt;/li&gt;
&lt;li&gt; Want speed + fun? → Antigravity&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both are amazing just like we developers need more than one tool in the toolbox. 😂🔧&lt;/p&gt;

</description>
      <category>cursor</category>
      <category>antigravity</category>
      <category>ai</category>
      <category>llm</category>
    </item>
    <item>
      <title>Meet UV: The Next-Gen Python Package Manager Built for Speed and Simplicity</title>
      <dc:creator>Sumanta Swain</dc:creator>
      <pubDate>Thu, 30 Oct 2025 14:42:46 +0000</pubDate>
      <link>https://forem.com/epam_india_python/meet-uv-the-next-gen-python-package-manager-built-for-speed-and-simplicity-3og7</link>
      <guid>https://forem.com/epam_india_python/meet-uv-the-next-gen-python-package-manager-built-for-speed-and-simplicity-3og7</guid>
      <description>&lt;p&gt;UV is a blazing-fast, modern Python package manager designed to simplify dependency management and virtual environments. Built with performance in mind, UV replaces traditional tools like pip, virtual env, and pip-tools by offering a unified, Rust-powered solution that dramatically speeds up installs and resolves dependencies with precision. Whether you're managing complex projects or just starting out, UV streamlines your workflow with minimal configuration and maximum efficiency.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Python's evolution has always been closely tied to advancements in package management. From manual installations to modern tools like pip, poetry, and virtual env, developers have witnessed significant progress over the years. Yet, as projects grow larger and more complex, traditional tools often fall short in speed, efficiency, and usability—hindering developers from achieving smooth project workflows.&lt;/p&gt;

&lt;p&gt;Enter &lt;strong&gt;UV&lt;/strong&gt;, a &lt;strong&gt;next-gen Python package and project manager&lt;/strong&gt; designed to address these shortcomings. Written in Rust, UV is a cutting-edge tool that combines the functionality of widely used tools like pip, poetry, and virtual env—but with &lt;strong&gt;exceptional performance&lt;/strong&gt;, simplicity, and reliability.&lt;/p&gt;

&lt;p&gt;In this article, we’ll explore UV, its unique features, benchmarks, step-by-step installation, and how developers can use it effectively for dependency management, virtual environments, Python installations, and more.&lt;/p&gt;

&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt; Why Does pip Fall Short?&lt;/li&gt;
&lt;li&gt; What is UV?&lt;/li&gt;
&lt;li&gt; Key Features of UV&lt;/li&gt;
&lt;li&gt; Benchmarks&lt;/li&gt;
&lt;li&gt; Installation Guide&lt;/li&gt;
&lt;li&gt; Using UV for Virtual Environments&lt;/li&gt;
&lt;li&gt; Building a Flask App with UV&lt;/li&gt;
&lt;li&gt; Installing Python with UV&lt;/li&gt;
&lt;li&gt; CLI Tools with UV&lt;/li&gt;
&lt;li&gt; Cheat sheet for UV Operations&lt;/li&gt;
&lt;li&gt; Current Limitations&lt;/li&gt;
&lt;li&gt; Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why Does pip Fall Short?
&lt;/h2&gt;

&lt;p&gt;pip is unquestionably one of the most popular package management systems in Python, facilitating the installation and management of software packages. However, its limitations have been widely criticized by developers over the years:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Slow Installations:&lt;/strong&gt; Developers often complain about the slowness of pip installations, especially in projects with numerous dependencies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dependency Smells:&lt;/strong&gt; Poorly configured dependency files can lead to version conflicts, reduced maintainability, and increased project complexity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Inconsistent Environment Restoration:&lt;/strong&gt; Recreating runtime environments using pip often struggles to match Python code perfectly, leading to reliability issues during deployment.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What is UV?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;UV&lt;/strong&gt; is a modern, &lt;strong&gt;high-performance Python package manager&lt;/strong&gt;, developed by the creators of &lt;strong&gt;ruff&lt;/strong&gt; and written in &lt;strong&gt;Rust&lt;/strong&gt;. It is designed as a &lt;strong&gt;drop-in replacement&lt;/strong&gt; for tools like pip, pip-tools, and virtual env—while offering superior speed and functionality.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;UV&lt;/strong&gt; combines the best aspects of existing tools while incorporating innovative features that address common pain points in dependency management, environment creation, and project workflows. With &lt;strong&gt;cross-platform support&lt;/strong&gt; (Linux, macOS, and Windows) and extensive testing against the PyPI index, UV aims to simplify Python development for both new and experienced programmers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Features of UV
&lt;/h2&gt;

&lt;p&gt;UV stands out from traditional package management tools due to its impressive features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;⚖️ &lt;strong&gt;Drop-in Compatibility:&lt;/strong&gt; Seamlessly replaces pip, pip-tools, and virtual env with minimal friction.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;⚡ &lt;strong&gt;Blazing Speed:&lt;/strong&gt; Up to 100x faster than pip for dependency resolution and installation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;💾 &lt;strong&gt;Efficient Disk Space Usage:&lt;/strong&gt; Minimizes storage usage using global dependency caching.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;🐍 &lt;strong&gt;Flexible Installation Options:&lt;/strong&gt; Installable via curl, pip, pipx, or natively via package managers like Homebrew and Pacman.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;🧪 &lt;strong&gt;Thorough Testing:&lt;/strong&gt; Verified for scale on over 10,000 PyPI packages.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;🖥️ &lt;strong&gt;Cross-Platform Support:&lt;/strong&gt; Compatible with macOS, Linux, and Windows.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;🔩 &lt;strong&gt;Advanced Dependency Management:&lt;/strong&gt; Offers alternative resolution strategies, conflict tracking, and version overrides.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;🚀 &lt;strong&gt;Unified Tooling:&lt;/strong&gt; Combines features of pip, poetry, pyenv, twine, and related tools into a single solution.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;🏢 &lt;strong&gt;Workspace Management:&lt;/strong&gt; Simplifies scalable projects with Cargo-style workspace handling.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Benchmarks
&lt;/h2&gt;

&lt;p&gt;UV’s speed is one of its defining features. It is significantly faster than traditional tools in environments with both warm and cold caches:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvyzurs7ovbzykbt8wvhy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvyzurs7ovbzykbt8wvhy.png" alt=" " width="800" height="383"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;Installing &lt;strong&gt;uv&lt;/strong&gt; is quick and straightforward. You can opt for standalone installers or install it directly from PyPI.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# On macOS and Linux.
curl -LsSf https://astral.sh/uv/install.sh | sh

# On Windows.
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"

# With pip.
pip install uv

# With pipx.
pipx install uv

# With Homebrew (Mac).
brew install uv

# With Pacman (Linux).
pacman -S uv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvhudfa68ijrn2g0mjhlk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvhudfa68ijrn2g0mjhlk.png" alt=" " width="689" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6syme4mo7ucsks4irg0h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6syme4mo7ucsks4irg0h.png" alt=" " width="800" height="569"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Using UV for Virtual Environments
&lt;/h2&gt;

&lt;p&gt;Creating and activating virtual environments with UV is straightforward:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Create a Virtual Environment
uv venv

# Activate the Virtual Environment On(macOS/Linux):
source .venv/bin/activate

# On Windows
.venv\Scripts\activate

# Installing packages follows standard commands:
uv pip install flask                       # Install Flask.  
uv pip install -r requirements.txt         # Install from a file.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5gb4z9jslb1pyikhdqnb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5gb4z9jslb1pyikhdqnb.png" alt=" " width="800" height="204"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnyzzice55vx014dt4ii5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnyzzice55vx014dt4ii5.png" alt=" " width="800" height="160"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Building a Flask App with UV
&lt;/h2&gt;

&lt;p&gt;Here’s how to use UV to set up and run a Flask applications.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8hbd1wtvlvssrkhri4aj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8hbd1wtvlvssrkhri4aj.png" alt=" " width="800" height="142"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2pqu1jkwuya8ssc61os4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2pqu1jkwuya8ssc61os4.png" alt=" " width="800" height="272"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqn7egavjkpxhmeukugyt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqn7egavjkpxhmeukugyt.png" alt=" " width="800" height="182"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa1r3l13dktxwpgsdxw7o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa1r3l13dktxwpgsdxw7o.png" alt=" " width="800" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Python Versions with UV
&lt;/h2&gt;

&lt;p&gt;UV can optionally install Python versions with ease:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Install Specific Python Version
uv python install 3.12
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  CLI Tools with UV
&lt;/h2&gt;

&lt;p&gt;UV supports installing CLI tools like &lt;strong&gt;huggingface_hub&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uv tool install huggingface_hub
uv tool list                       # Lists all installed tools.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fziaf6lt14a57k2b5us3d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fziaf6lt14a57k2b5us3d.png" alt=" " width="800" height="435"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  UV Commands Cheat Sheet
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Virtual Environment Management
uv venv                                # Create a virtual environment
uv activate                            # Activate the virtual environment
uv deactivate                          # Deactivate the virtual environment

# Dependency Management
uv pip install flask                   # Install 'flask' dependency
uv pip install &amp;lt;package&amp;gt;==&amp;lt;version&amp;gt;    # Install a specific version of a package
uv pip list                            # List installed dependencies in the current environment
uv pip uninstall &amp;lt;package&amp;gt;             # Uninstall a package

# Running Python Scripts
uv run script.py                       # Run Python script located at "script.py"
uv python                              # Start Python REPL in the UV environment

# Python Version Management
uv python install 3.12                 # Install Python version 3.12
uv python list                         # List Python versions available or installed
uv python use 3.12                     # Use Python version 3.12

# CLI Tool Management
uv tool install &amp;lt;tool&amp;gt;                 # Install a CLI tool
uv tool list                           # List installed CLI tools
uv tool update &amp;lt;tool&amp;gt;                  # Update a CLI tool
uv tool uninstall &amp;lt;tool&amp;gt;               # Uninstall a CLI tool

# Miscellaneous
uv --version                           # Check UV version
uv help                                # Display help menu for UV commands
uv pip freeze &amp;gt; requirements.txt       # Generate a `requirements.txt` file of installed packages
uv pip install -r requirements.txt     # Install dependencies from `requirements.txt`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Current Limitations
&lt;/h2&gt;

&lt;p&gt;While UV is promising, it isn’t perfect:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Incomplete Compatibility with Pip:&lt;/strong&gt; UV doesn’t yet cover all pip features, though its minimalist design compensates for this gap.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Platform-Specific Requirements Files:&lt;/strong&gt; Like pip-compile, UV generates platform-specific requirements files, which may limit portability across operating systems.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;UV is not just another Python package manager—it’s a &lt;strong&gt;game-changer&lt;/strong&gt; that eliminates common developer frustrations. With its speed, simplicity, and modern features, UV represents the future of Python dependency management.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt;&lt;br&gt;
This is a personal blog. The views and opinions expressed here are only those of the author and do not represent those of any organization or any individual with whom the author may be associated, professionally or personally.&lt;/p&gt;

</description>
      <category>python</category>
      <category>uv</category>
      <category>programming</category>
      <category>code</category>
    </item>
  </channel>
</rss>
