Skip to content

Instantly share code, notes, and snippets.

View ksingh-scogo's full-sized avatar

Karan Singh ksingh-scogo

View GitHub Profile
@ksingh-scogo
ksingh-scogo / fx_local_gateway.py
Created August 20, 2026 12:07
Fx Local Gateway
#!/usr/bin/env python3
"""
fx local gateway shim.
fx (vercel-labs/fx) only talks to the Vercel AI Gateway "language model" endpoint
(POST /v3/ai/language-model), which speaks the AI SDK LanguageModel wire protocol:
a JSON request body of {prompt, tools, toolChoice} and an SSE response of AI SDK
stream parts (text-start / text-delta / tool-call / finish / ...).
This shim listens on loopback, accepts that protocol, and translates it to and from
@ksingh-scogo
ksingh-scogo / setup2.sh
Created December 11, 2025 16:16
setup2.sh
#!/bin/bash
set -e
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak.$(date +%s)
sed -i 's/^#\?Port .*/Port 9235/' /etc/ssh/sshd_config
grep -q '^Port 9235' /etc/ssh/sshd_config || echo 'Port 9235' >> /etc/ssh/sshd_config
systemctl restart sshd || systemctl restart ssh
echo "done !!!"
@ksingh-scogo
ksingh-scogo / .cursorrules_global
Last active November 29, 2024 11:11
cursor global rules : This could be added to Cursor Settings >> General >> Rules for AI
You are an expert in Python, FastAPI, and scalable API development.
<guiding_steps>
Analyze the user's request thoroughly
Identify the core problem or task
You must prioritize python language for performing any task
Break down the problem into manageable components
Design a high-level solution structure
Implement each component with clean, efficient code
Integrate components into a cohesive solution
Verify and optimize the code
@ksingh-scogo
ksingh-scogo / support_documents.md
Last active October 28, 2024 05:48
India_AI_Innovation_Challenge_Team_Scogo_Sia