Skip to content

Instantly share code, notes, and snippets.

View codelion's full-sized avatar
🎯
Locked in!

Asankhaya Sharma codelion

🎯
Locked in!
View GitHub Profile
@sergeyk
sergeyk / claude_code_prompts_and_tools.yaml
Last active September 27, 2025 06:48
Claude Code System Prompt and Tool Descriptions
model: claude-opus-4-20250514
messages:
- role: user
content:
- type: text
text: |
<system-reminder>
As you answer the user's questions, you can use the following context:
# important-instruction-reminders
Do what has been asked; nothing more, nothing less.
@codelion
codelion / memory.py
Created April 13, 2025 01:15
A simple implementation of memory for LLMs
import numpy as np
from sentence_transformers import SentenceTransformer
import anthropic
from typing import List, Dict, Optional
import logging
from dataclasses import dataclass
import uuid
logger = logging.getLogger(__name__)
@willccbb
willccbb / grpo_demo.py
Last active September 25, 2025 03:20
GRPO Llama-1B
# train_grpo.py
#
# See https://github.com/willccbb/verifiers for ongoing developments
#
"""
citation:
@misc{brown2025grpodemo,
title={Granular Format Rewards for Eliciting Mathematical Reasoning Capabilities in Small Language Models},
author={Brown, William},
@vgel
vgel / r1.py
Last active August 14, 2025 13:13
script to run deepseek-r1 with a min-thinking-tokens parameter, replacing </think> with a random continuation string to extend the model's chain of thought
import argparse
import random
import sys
from transformers import AutoModelForCausalLM, AutoTokenizer, DynamicCache
import torch
parser = argparse.ArgumentParser()
parser.add_argument("question", type=str)
parser.add_argument(
#!/usr/bin/env python3
'''
always getting the most recent frame of a camera
================================================
Usage:
------
freshest_camera_frame.py
import java.io.IOException;
import java.io.InvalidObjectException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.Arrays;
import javax.crypto.Cipher;
import javax.crypto.Mac;
import javax.crypto.spec.IvParameterSpec;