Skip to content

Instantly share code, notes, and snippets.

@w601sxs
w601sxs / wtfmcp.md
Last active April 15, 2025 16:15
WTF MCP

Not heard enough about MCP yet?

Unlike traditional APIs that require rigid pre-defined integrations, MCP acts as a universal translator between large language models and enterprise systems (and other loosely defined "tools"), maintaining context across interactions and enabling real-time discovery of resources. You knew this part already. Let's answer some common questions that have come up (including whats in the title). Later in this post, we'll dissect an actual MCP implementation for Amazon Bedrock Knowledge Bases to understand how this protocol bridges the gap between human-like queries and machine-readable data.

The Question Everyone Asks: "But someone still needs to build the APIs, right?"

Let's address this confusion directly: Yes, developers still create interfaces to data and tools - but MCP fundamentally changes how, when, and by whom these interfaces are used.

The key difference is that MCP creates a standardized way for these interfaces to be connected at runtime by users rather

@w601sxs
w601sxs / Deepseek v3 MHA.md
Last active December 31, 2024 20:13
Deepseek v3 MHA
  • Key and Value Compression: The input for the $t$-th token at an attention layer is denoted as $\mathbf{h}_t \in \mathbb{R}^d$, where $d$ is the embedding dimension.

  • A compressed latent vector for keys and values, $\mathbf{c}_t^{KV} \in \mathbb{R}^{d_c}$, is computed using a down-projection matrix$W^{DKV} \in \mathbb{R}^{d_c \times d}$ : $\mathbf{c}_t^{KV} = W^{DKV} \mathbf{h}_t$

  • Here, $d_c (\ll d_h n_h)$ is the KV compression dimension, much smaller than the total dimension of keys and values.

  • Keys ($\mathbf{k}_t^C$) and values ($\mathbf{v}_t^C$) are reconstructed from $\mathbf{c}_t^{KV}$ using up-projection matrices $W^{UK}, W^{UV} \in \mathbb{R}^{d_h n_h \times d_c}$.

  • So $[\mathbf{k}{t,1}^C; \dots; \mathbf{k}{t,n_h}^C] = W^{UK} \mathbf{c}t^{KV}$, and $[\mathbf{v}{t,1}^C; \dots; \mathbf{v}_{t,n_h}^C] = W^{UV} \mathbf{c}_t^{KV}$

  • Rotary Positional Embedding (RoPE): A decoupled key vector carrying positional information ($\mathbf{k}_t^R$) is generated using a separate projectio

@w601sxs
w601sxs / gist:f16d5d9b83429b419bc840cff82ab867
Created December 16, 2019 16:22
Dask distributed dockerfile
FROM continuumio/miniconda3:4.3.14
# Dumb init
RUN wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64
RUN chmod +x /usr/local/bin/dumb-init
RUN conda update conda && conda install "conda=4.4.7"
RUN conda install --yes \
python-blosc \
cytoolz \
@w601sxs
w601sxs / README.md
Created March 24, 2017 13:47 — forked from debashisbarman/README.md
A Twitter bot that can retweet in response to the tweets matching particluar keyword (https://goo.gl/4whEIt)

#Creating a Twitter bot with Node.js Learn how you can create your own Twitter bot using Node.js and the new Twitter API. The bot will auto retweet in response to tweets with some particular hashtags. (https://goo.gl/4whEIt)

##Tools we need Here are the tools we’ll be using to create the bot — 

  • Node.js installed in your machine
  • A registered Twitter account

Create a Twitter application