Skip to content

Instantly share code, notes, and snippets.

View connectwithprakash's full-sized avatar

Prakash Chaudhary connectwithprakash

View GitHub Profile
@connectwithprakash
connectwithprakash / skill-eval-benchmark.md
Last active April 3, 2026 06:41
Skill eval benchmark results for labs-skills PR #16 (summarizing-specs + gathering-coding-context)
@connectwithprakash
connectwithprakash / README.md
Last active March 19, 2026 01:49
Tool-as-Code vs ReAct Benchmark: 20 free public API tools, 10 queries, 60 runs. 79% token savings.

Tool-as-Code vs ReAct Benchmark

A self-contained benchmark comparing two LLM tool-calling patterns across queries of varying complexity (1 tool through 8+ tools).

Tool-as-Code vs ReAct

  • Tool-as-Code: LLM generates a complete Python function in one shot, executes locally. Tool results never re-enter the LLM context.
  • ReAct: Standard agent loop -- LLM calls tools one at a time, reads each result, decides the next step.

Both use GPT-4.1 with the same 20 tools. The benchmark measures tokens, latency, and LLM round-trips.

@connectwithprakash
connectwithprakash / cropping_algorithm.py
Last active February 3, 2020 17:13
This is the actual windowing based cropping algorithm
def check_constraints(constraints, image_dim, window_axes):
# checks the movement of axes possible or not
move_left, move_right, move_up, move_down = constraints
x, y = image_dim
x1, x2, y1, y2 = window_axes
if x1<=0: move_left = False
if x2>=x: move_right = False
if y1<=0: move_up = False
if y2>=y: move_down = False
@connectwithprakash
connectwithprakash / crop_image_with_face_center.py
Created February 1, 2020 20:02
Cropping image of desired aspect ratio using windowing algorithm with center of window taken from face detection model.
detector = MTCNN() # face detection model
image = plt.imread(input_file_path)
results = detector.detect_faces(image)
confidences = [result['confidence'] for result in results]
index = np.argmax(confidences)
x1, y1, ww, hh = results[index]['box']
h, k = x1+ww//2, y1+hh//2
image = crop(image, (h, k), aspect_ratio)
@connectwithprakash
connectwithprakash / crop_image_with_known_center.py
Created February 1, 2020 20:00
Cropping image of desired aspect ratio using windowing algorithm with known center of window/
image = plt.imread(file_path)
m, n = image.shape[0:-1]
image = crop(image, center=(m//2+290, n//2), aspect_ratio=(1.4/2.0))
plt.imsave('output.jpg', image)
@connectwithprakash
connectwithprakash / min-char-rnn.py
Created October 20, 2019 14:28 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@connectwithprakash
connectwithprakash / apply_filter.py
Last active October 18, 2019 14:00
Apply custom filter for convolution on image
def get_filter_output(input_img_path, filter):
img = plt.imread(input_img_path)
filter_size = filter.shape[0]
pad_width = (filter_size-1)//2
if len(img.shape)==3:
filter_3D = np.stack((filter, filter, filter), axis=2)
temp = np.pad(img, ((pad_width, pad_width), (pad_width, pad_width), (0, 0)), mode='constant', constant_values=0)
temp = np.array([[np.sum(np.multiply(temp[i:i+filter_size, j:j+filter_size, :], filter_3D)) for j in range(temp.shape[1]-filter_size+1)] for i in range(temp.shape[0]-filter_size+1)])
else:
temp = np.pad(img, ((pad_width, pad_width), (pad_width, pad_width)), mode='constant', constant_values=0)
@connectwithprakash
connectwithprakash / Capstone Final Project.ipynb
Created July 9, 2019 15:06
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@connectwithprakash
connectwithprakash / clustering.ipynb
Created June 26, 2019 12:50
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@connectwithprakash
connectwithprakash / Toronto_Neighborhood.ipynb
Created June 26, 2019 06:28
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.