Skip to content

Instantly share code, notes, and snippets.

View bigsnarfdude's full-sized avatar

BigsnarfDude bigsnarfdude

View GitHub Profile
Counter-Controls Beyond ECC:
Detection & Monitoring:
Model integrity checksums: Hash model weights at regular intervals during training
Behavioral baselines: Monitor for unexplained accuracy drops or training anomalies
Memory error logging: Track unusual DRAM errors even with ECC enabled
Performance profiling: Unusual memory access patterns could indicate attacks
Operational Controls:
# Reinforcement learning models for network formation applied to LLM chat usage patterns
The application of reinforcement learning network formation models, particularly the Kious and Tarrès framework, presents a compelling approach for predicting and understanding LLM chat usage patterns. This research reveals **77%+ prediction accuracy** using existing frameworks, with multiple pathways for implementing network-based models that capture the complex dynamics of human-AI interactions through reinforcement learning mechanisms.
## The Kious-Tarrès framework maps naturally to LLM interactions
The Kious and Tarrès reinforcement learning framework for social networks, introduced in their 2016 paper, provides a sophisticated model where agents learn communication strategies through probabilistic selection based on past success. In this framework, vertices represent individual agents who select neighbors with probability proportional to their past number of successful communications. When applied to LLM interacti
@bigsnarfdude
bigsnarfdude / tool_calling_ollama.py
Last active September 1, 2025 21:43
tool_calling_ollama.py
#!/usr/bin/env python3
"""
Simple Working Ollama Tool Calling Script for gpt-oss
"""
import json
import requests
from datetime import datetime
import os
import re
System Architecture
Core Components:
Document Processor - Breaks documents into checkable units (paragraphs/sections)
Regulation Database - Searchable knowledge base of regulations
Ollama LLM - For tool calling and reasoning about compliance
Annotation Engine - Marks up documents with findings
Review Interface - For human oversight
# Compliance Checking System - Implementation Plan
# Multi-Layered AI Defense Framework: Preventing Model Misuse
Based on Anthropic's Threat Intelligence team findings, this document outlines the comprehensive defense strategy employed to prevent AI model misuse while maintaining beneficial capabilities.
## The Defense-in-Depth Philosophy
AI companies like Anthropic cannot rely on a single security measure to prevent misuse. Instead, they implement multiple complementary layers of defense, recognizing that each individual layer has limitations and can potentially be circumvented.
## Layer 1: Model Training and Reinforcement Learning
@bigsnarfdude
bigsnarfdude / stereo_cameras.py
Last active August 27, 2025 01:06
stereo_cameras.py
#!/usr/bin/env python3
"""
Simple Stereo Heatmap - 1080p Brio Cameras
Focus on good depth visualization with live tuning
"""
import cv2
import numpy as np
import time
@bigsnarfdude
bigsnarfdude / pushup.py
Created August 24, 2025 04:09
pushup.py
#!/usr/bin/env python3
"""
Real-time Push-up Counter using MediaPipe Pose Detection
Tracks body pose and automatically counts push-ups based on arm angles
"""
import cv2
import mediapipe as mp
import numpy as np
import math
@bigsnarfdude
bigsnarfdude / catDog_training.py
Created August 19, 2025 17:38
catDog_training.py
"""
TRANSFER LEARNING WITH VGG16 FOR IMAGE CLASSIFICATION
====================================================
This script demonstrates transfer learning using a pre-trained VGG16 model.
Transfer learning is a technique where we use a model trained on one task
(ImageNet classification) to help solve a different but related task
(cats vs dogs classification).
Why Transfer Learning?
@bigsnarfdude
bigsnarfdude / gemma3_270.py
Created August 17, 2025 02:47
gemma3_270
# =============================================================================
# SIMPLE GEMMA 270M - JUST MAKE IT WORK
# No fallbacks, no complexity, just working inference
# =============================================================================
# CELL 1: Installation
# %%capture
import os
if "COLAB_" not in "".join(os.environ.keys()):
!pip install unsloth
@bigsnarfdude
bigsnarfdude / pro_mode.py
Last active August 8, 2025 17:51
pro_mode.py
#!/usr/bin/env python3
"""
Ollama Pro Mode - Multi-pass generation with synthesis
Using official ollama-python library for better API integration
"""
import time
from typing import List, Dict, Any, Optional
import concurrent.futures as cf
from dataclasses import dataclass