Skip to content

Instantly share code, notes, and snippets.

View s-sajid-ali's full-sized avatar

Sajid Ali s-sajid-ali

View GitHub Profile
@s-sajid-ali
s-sajid-ali / dirge-oci-index-bug-report.md
Last active August 7, 2026 23:16
dirge bug: sandbox setup fails with 'no layers found in manifest' for multi-arch GHCR images (Accept header missing OCI index media types)

dirge sandbox setup fails with "no layers found in manifest" for multi-arch GHCR images

Summary

dirge sandbox setup --image <multi-arch OCI image> fails with:

Error: no layers found in manifest for <owner>/<repo>/<image>:<tag>
@s-sajid-ali
s-sajid-ali / mlx_lm_lfm2_tool_calling_fix.md
Created August 7, 2026 20:16
Fix: mlx-lm doesn't detect LFM2's tool-call format, silently drops tools param

Fixing "model does not support tool calling" for LFM2 on mlx-lm

Symptom

Running an OpenAI-compatible client (e.g. dirge or any openai SDK client) against mlx_lm.server serving LiquidAI/LFM2.5-2.6B-MLX-nvfp4 (or other LFM2 MLX conversions) with a tools=[...] payload produces this server-side warning, and the model never actually emits a tool call:

@s-sajid-ali
s-sajid-ali / portkey_mcp_trace_mwe.py
Created August 6, 2026 18:18
MWE: Portkey MCP Gateway tool calls don't join the AI Gateway trace (x-portkey-trace-id ignored)
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.10"
# dependencies = [
# "openai>=1.50",
# "pydantic-ai-slim[mcp,openai]>=0.4",
# "rich",
# ]
# ///
"""Minimal repro: MCP Gateway tool calls don't join the AI Gateway trace.
@s-sajid-ali
s-sajid-ali / portkey-pydantic-ai-bug.md
Created July 16, 2026 15:21
Bug: portkey-ai 2.3.2 — `TypeError: Object of type Omit is not JSON serializable`

Bug: portkey-ai 2.3.2 — TypeError: Object of type Omit is not JSON serializable

Affects: portkey-ai==2.3.2 used together with pydantic-ai>=2.9.0 and openai>=2.18.0
Symptom: TypeError raised inside portkey_ai._vendor.openai._utils._json before any network call is made
Reproducer: uv run --no-project reproducer.py (PEP 723 inline deps, no credentials needed)


Root cause

@s-sajid-ali
s-sajid-ali / overview.md
Last active May 19, 2026 15:32
portkey-networking-issues

In the ancient times ...

We had two kinds of traffic being handled as:

  graph TB
  subgraph traffic-from-outside
  GCP-LB-->|"restrict to specific IP addresses"|MetalLB
  end
  subgraph on-prem-boundary
 MetalLB--&gt;|"bind to service via NodePort"|LLMGateway
@s-sajid-ali
s-sajid-ali / test-dataset-submitted-input.md
Last active April 30, 2026 19:22
batch-inference-google-search

Contents of input JSONL:

> bat test_dataset.jsonl
─────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
     │ File: test_dataset.jsonl
─────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1 │ {"custom_id":"request-1","method":"POST","url":"/v1/chat/completions","body":{"model":"gemini-3-flash-preview","messages":[{"role":"user","content":"Where is NYU located
     │ ?"}],"max_tokens":2048}}
   2 │ {"custom_id":"request-2","method":"POST","url":"/v1/chat/completions","body":{"model":"gemini-3-flash-preview","messages":[{"role":"user","content":"What resources are a
     │ vailable for genAI research at nyu?"}],"tools":[{"type":"function","function":{"name":"google_search","description":"Retrieves search results from internet to expand con

Input

Input `veo_request.py`
from portkey_ai import Portkey
import json
import os

CSV Changes Required to Replicate Commit d23fe45 Behavior

Summary

Commit d23fe45 added facet matches to 4 storage services. However, the old system used numeric facet IDs while the new refactored system uses semantic facet IDs. Additionally, some old facets no longer exist in the new system.

Old Facet ID to Description Mapping

Based on the old facet-tree.json:

| Old ID | Facet Category | Description |

@s-sajid-ali
s-sajid-ali / slurm-ingest-from-dump.sh
Created May 19, 2025 14:36
slurm-ingest-from-dump
# basic version from claude-3.7
#!/bin/bash
# Define the dump file path
DUMP_FILE="/slurm-dump/f-k8s-dev.cfg"
# Function for error handling
handle_error() {
local exit_code=$1
local error_message=$2
@s-sajid-ali
s-sajid-ali / gist:bbf0328c7fe1ecb3090d43fb3381f28c
Created April 15, 2023 00:35
spack-spec-openpmd-hdf5-ompi-nocrash-wc-work1
{
"spec": {
"_meta": {
"version": 3
},
"nodes": [
{
"name": "openpmd-api",
"version": "0.15.1",
"arch": {