Skip to content

Instantly share code, notes, and snippets.

View rajivmehtaflex's full-sized avatar
🚀
smile

Rajiv Mehta rajivmehtaflex

🚀
smile
  • Bacancy Technology
  • Ahmedabad
View GitHub Profile
@rajivmehtaflex
rajivmehtaflex / Direct_Package_installation_via_UV.md
Last active July 10, 2026 16:11 — forked from WolframRavenwolf/HOWTO.md
HOWTO: Use Skills, Qwen3-Coder (or any other LLM) with Claude Code (via LiteLLM)

/// script

requires-python = ">=3.10"

dependencies = [

"vllm",

"transformers",

"datasets",

]

///

Your Python code here

@rajivmehtaflex
rajivmehtaflex / GEMINI-CLI-FLOW.md
Last active July 31, 2026 08:34
Codex-Prompt-Task-master-Operations
  • For complex tasks, I never ask for code first. My initial prompt is to create a plan "Create a detailed implementation plan for [FEATURE, BUG]".
  • Create multiple hierarchical GEMINI md files defining roles, helpful code snippets, and a strict rule: "You cannot edit this file."
  • Collaboration >> YOLO. I don't use a "YOLO mode" and rather intercept and re-prompt.
  • Use MCP servers to access bugs, issues, browsers, Github (& internal tools), or run code in sandboxes.
  • Leverage the 1M Context. Instruct it to read a lot of files into context or use “@” primitives.
  • Code → Test → Commit. I force it to write tests or execute code snippets and have it fix it in a loop.

Gemini CLI comes with a free usage for Gemini 2.5 Pro. Give it a try and let us know what you think.

@rajivmehtaflex
rajivmehtaflex / browser_ui_config.py
Created March 10, 2025 11:30
browser_use Related Notes.
#uv add browser-use
#playwright install-dep
#playwright install-deps
#playwright install
import asyncio
from dotenv import load_dotenv
from langchain_openai import ChatOpenAI
from browser_use.browser.browser import Browser, BrowserConfig
from browser_use import Agent
@rajivmehtaflex
rajivmehtaflex / LOCAL_MCP_SERVER_SCRIPTING.md
Last active July 8, 2025 16:41
Local MCP Scripting with AICHAT-UTILS-DESCRIPTION

MCP Local Server Setup Guide

A complete step-by-step guide to create a local MCP (Model Context Protocol) server from scratch.

Prerequisites

  • Python 3.12 or higher
  • uv package manager installed (Install uv)

Step-by-Step Setup

@rajivmehtaflex
rajivmehtaflex / install_rust.sh
Created January 13, 2025 09:49
Rust based Ops
#!/bin/bash
# Set errexit to exit immediately if a command exits with a non-zero status
set -e
# Print a message indicating the start of the script
echo "Starting Rust installation script..."
# Download and execute the rustup installer
echo "Downloading and executing rustup installer..."
@rajivmehtaflex
rajivmehtaflex / UNDERSTANDING_TRANSFORMERS.md.md
Last active July 5, 2026 05:12 — forked from Maharshi-Pandya/contemplative-llms.txt
"Contemplative reasoning" response style for LLMs like Claude and GPT-4o

How LLMs Actually Work: A Plain-English Guide to Transformer Architecture

A from-scratch walkthrough of what happens between typing a prompt and getting a response — no ML background assumed.

What This Guide Covers

Every large language model — GPT-4, Claude, Gemini, Llama — is built on the same core idea. This guide follows that idea in the exact order data actually flows through a real model: text in, tokens, vectors, 80 stacked layers, and a word out — then loops back to explain how the model got trained in the first place. Read it top to bottom; each section is built to need only what came before it.

  1. The One Job an LLM Has
  2. Vectors — Turning Words Into Math
import asyncio
import base64
import json
import os
import pyaudio
from websockets.asyncio.client import connect
class SimpleGeminiVoice:
def __init__(self):
@rajivmehtaflex
rajivmehtaflex / gemini_ops.md
Last active December 26, 2024 13:54
Demonstrates the use of Google's Gemini 2.0 Flash model with "thinking" output enabled, showing how the model reveals its thought process while solving a simple math problem.

File: gemini_thinking_deep.py

from google import genai
import os
os.environ['GEMINI_API_KEY'] = '<KEY>'

client = genai.Client(
    api_key=os.environ['GEMINI_API_KEY'],
    http_options={

Custom Context Provider for Continue.dev VS Code Extension

This gist demonstrates how to create a custom context provider for the Continue.dev VS Code extension using a FastAPI server. This allows you to integrate external data sources or custom logic into the Continue.dev context.

Overview

The provided code consists of two files:

  1. server.py: A Python file that sets up a FastAPI server with a single endpoint /check. This endpoint receives data in the form of a JSON object, and returns a JSON response with content and description.
  2. requirements.txt: A text file that lists the Python dependencies required to run the FastAPI server.
@rajivmehtaflex
rajivmehtaflex / Mac_os_set_default_python.md
Last active December 17, 2024 05:43
Steps to set up a fast MCP server using uv

Setting Python 3.12 as Default on macOS Sequoia 15.2

This guide explains how to set Python 3.12 as the default Python version on macOS Sequoia 15.2, so that typing python in the terminal runs Python 3.12. It also covers keeping the ability to call any Python 3.x version using python3.

Understanding the Situation

  • macOS System Python: macOS has a system Python installation at /usr/bin/python, used by the OS and should not be modified.
  • Multiple Python Versions: You likely have multiple Python versions installed, possibly via Homebrew.
  • python vs. python3: Typically, python points to an older version, while python3 specifically calls Python 3. The goal is to have python point to 3.12 while still being able to use python3 for other 3.x versions.