Skip to content

Instantly share code, notes, and snippets.

import React, { useState, useEffect, useRef } from 'react';
export default function TokenCounter() {
const [text, setText] = useState('');
const [tokenCount, setTokenCount] = useState(null);
const [rawApiCount, setRawApiCount] = useState(null);
const [loading, setLoading] = useState(false);
const [error, setError] = useState(null);
const [overhead, setOverhead] = useState(null);
const [calibrating, setCalibrating] = useState(false);
@AranKomat
AranKomat / vuln.md
Last active April 16, 2026 06:44
aab

Speaking of vulnerability task, my current view is that the right framing is discovery -> fixing, not “can one open model replace Opus everywhere.”

Discovery is the expensive part because it has to search broadly across a codebase. Fixing / patching is narrower once the relevant area is identified, so it is much more plausible to spend frontier-model dollars there.

Aisle’s earlier point was that the moat is the system / scaffold, not just the base model. (AISLE1) Their new post strengthens that materially: they now describe a public whole-codebase scanner, nano-analyzer, that scans files independently in three stages — context generation, vulnerability scan, and skeptical triage with grep plus an arbiter — and they report that it can replay the flagship Mythos FreeBSD bug and surface new real bugs from full-kernel scans. ([AISLE2](https://aisle.com/blog/system-over-model-zero-day-discovery-at-the-jagged-frontier "S

import math
import jax
import jax.numpy as jnp
from flax import linen as nn
from flax.core import freeze, unfreeze
from mingpt.utils import CfgNode as CN
# -----------------------------------------------------------------------------
import jax
import jax.numpy as jnp
from functools import partial
from jax import vmap
def scatter(input, dim, index, src, reduce=None):
# Works like PyTorch's scatter. See https://pytorch.org/docs/stable/generated/torch.Tensor.scatter_.html
dnums = jax.lax.ScatterDimensionNumbers(update_window_dims=(), inserted_window_dims=(0,), scatter_dims_to_operand_dims=(0,))
import io
import zipfile
from pathlib import Path
import threading as th
from multiprocessing.pool import ThreadPool
import cv2
import urllib
from contextlib import contextmanager
from datadings.tools.cached_property import cached_property
from string import hexdigits
import os
import json
from time import time
from time import time
t = time()
TXT_PATH = "./80m-dataset/img"
paths = []
max_num = 90000000
max_idx = max_num // 1000
import argparse
import os
import json
import multiprocessing
from glob import glob
from os.path import join
from tqdm.contrib.concurrent import process_map
parser = argparse.ArgumentParser()
parser.add_argument('--data_path', default='')
import types
from typing import Any, Optional
from .moving_average import ExponentialMovingAverage
from flax import linen as nn
import jax
import jax.numpy as jnp
# inspired from Haiku's corresponding code to Flax
class VectorQuantizerEMA(nn.Module):
@AranKomat
AranKomat / arch.py
Created August 13, 2020 09:41
Incomplete implmenetation of extended MARGE architecture
import torch
from torch.nn import Parameter
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
import math
import numpy as np
from torch.autograd import Function
#from torch_scatter import scatter
import torch
from torch.nn import Parameter
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
import math
import numpy as np
from torch.autograd import Function
try:
from torch_scatter import scatter