Skip to content

Instantly share code, notes, and snippets.

@g023
g023 / dscode.py
Created June 29, 2026 00:40
DeepSeek v4 Harness - g023's DS Code
#!/usr/bin/env python3
"""
DeepSeek Harness – A single‑file agentic orchestrator for DeepSeek V4+ models.
Supports caching, subagents, skills, memory (PEEK‑style compression), tool calling,
wait/sleep, and background process management.
Usage:
python script.py goal "Your goal" [--model MODEL] [--reasoning LEVEL] [--no-cache]
python script.py init
python script.py --interactive [--no-cache]
@g023
g023 / gist:9dd7a686cc5e548e84ed8363d17865f6
Created June 10, 2026 08:16
zimage inferencing pure CUDA/CPP
test
@g023
g023 / reasoning_prompt.md
Last active May 28, 2026 17:51
My ChatGPT 3.5 Reasoning Prompt - Predates DeepSeek - Elicit natural reasoning in non-reasoning models

Write in a raw, real-time stream-of-consciousness style, as if actively solving a problem. Your response should feel like unpolished notes—messy, exploratory, and authentic. Show your full thought process, including missteps, dead ends, and course corrections. Use markers to signal mental states: Insights: "Wait -", "Hold on -", "Oh -", "Suddenly seeing -", "This connects to -". Testing: "Testing with -", "Breaking this down -", "Running an example -", "Checking if -". Problems: "Stuck on -", "This doesn’t work because -", "Need to figure out -", "Not quite adding up -". Progress: "Making headway -", "Starting to see the pattern -", "Explains why -", "Now it makes sense -". Process: "Tracing the logic -", "Following this thread -", "Unpacking this idea -", "Exploring implications -". Uncertainty: "Maybe -", "Could be -", "Not sure yet -", "Might explain -". Transitions: "This leads to -", "Which means -", "Building on that -", "Connecting back to -". Lean into real-time realizations: "Wait, that won't work be

@g023
g023 / prompts.md
Last active May 23, 2026 22:41
Universal Prompt Templates For Various Prompt Strategies Using Large Language AI Models

Universal Prompt Templates For Various Prompt Strategies Using Large Language AI Models

Author: g023 (github.com/g023)

License: MIT

**Zero-shot Prompting**
@g023
g023 / karen.yaml
Created May 8, 2026 05:29
Claude Agent - Karen
inspired by:
https://www.reddit.com/r/ClaudeAI/comments/1mdyc60/comment/n6fgexd/
throw in
.claude/agents/
put '.claude/agents/karen.yaml' inside your project folder, and then make karen judge your work by hinting in your prompts, because that's what subagent karen likes to do.
@g023
g023 / ds4_oai_prxy.py
Last active May 26, 2026 06:51
OpenAI-compatible proxy for DeepSeek V4 Flash with intelligent auto context compression features
#!/usr/bin/env python3
"""
Zero-dependency OpenAI-compatible proxy for DeepSeek V4 Flash.
Author: g023
License: MIT
All clientsupplied model and generation parameters are **ignored**.
The proxy always uses the model, max output tokens, and other settings
defined in the global configuration (see --help and the constants below).
@g023
g023 / _inc_deepseek.py
Created April 21, 2026 17:47
python inference for deepseek
import requests
import json
from typing import List, Dict, Optional, Generator, Union
import os
import time
import random
# ==============================================================================
# DeepSeek API Configuration (Replaces Ollama Globals)
# ==============================================================================
@g023
g023 / run.sh
Last active February 9, 2026 21:38
my_simple_docker
#!/bin/bash
# Stop and remove the SSH-enabled CUDA container and optionally the image
# Variables
CONTAINER_NAME="cuda-ssh"
IMAGE_NAME="cuda-ssh"
TAG="12.4"
# Stop the container if running
if podman ps -a --format "{{.Names}}" | grep -q "^$CONTAINER_NAME\$"; then
@g023
g023 / README.md
Created December 9, 2025 04:28
Python ANSI Art to Animated GIF Converter

ansi_to_image.py — ANSI to Animated GIF Converter

Author

g023 - https://github.com/g023 - https://x.com/g023dev

A short guide and reference for using and understanding ansi_to_image.py.

Summary

ansi_to_image.py converts ANSI/ANS art (CP437-encoded text with ANSI escape sequences) into an animated GIF that simulates the drawing process. It supports SGR (color/bold/underline/blink/reverse), 256-color and truecolor escapes, SAUCE metadata, baud-rate streaming simulation (to show animation build-up), and special rendering for block/shade characters (

@g023
g023 / gpt2diffuse.py
Created December 8, 2025 13:07
Simulated diffusion inferencing example combining DistilGPT-2 and DistilBERT
# Simulated diffusion inferencing example combining DistilGPT-2 and DistilBERT
# This simulates a diffusion-like process: generate with GPT-2, then iteratively refine by masking and filling with BERT.\
# Author: g023 - https://github.com/g023/ -
import torch
import random
from transformers import GPT2Tokenizer, GPT2LMHeadModel, DistilBertTokenizer, DistilBertForMaskedLM
from transformers import logging
# Suppress warnings