Skip to content

Instantly share code, notes, and snippets.

View Farenheith's full-sized avatar

Thiago Oliveira Santos Farenheith

  • Grupo Boticário
  • São Paulo, Brazil
View GitHub Profile
@Farenheith
Farenheith / ds4-benchmark.md
Last active July 8, 2026 11:54
DeepSeek V4 Flash Q2 (antirez/ds4) – Quality Benchmark Report

DeepSeek V4 Flash Q2 (antirez/ds4) – Quality Benchmark Report

A skeptical, quality-focused comparison of antirez's aggressively quantized Q2 model against the vanilla DeepSeek V4 Flash and other popular local models.


1. Executive Summary

Antirez's Q2 quantization of DeepSeek V4 Flash is a hybrid, asymmetric quantization scheme that compresses the model to ~81 GB, making it runnable on 128 GB unified-memory machines (Apple Silicon M3/M5 Max, DGX Spark/GB10). The core insight: routed experts (the vast majority of parameters) are aggressively quantized to 2-bit, while critical components (router, shared experts, projections, embeddings, output layers) are kept in higher precision (Q8/F16/F32). The result is a model that retains surprisingly good quality despite extreme compression, consistently outperforming other local models in head-to-head benchmarks.

@Farenheith
Farenheith / launch.json
Last active September 2, 2024 00:51
Launch.json example for vscode using nvm to get node version directly from .nvmrc
{
"version": "0.2.0",
"configurations": [{
"type": "node",
"request": "launch",
"name": "Launch program",
"skipFiles": ["<node_internals>/**"],
"cwd": "${workspaceRoot}",
"envFile": "${workspaceFolder}/.env",
"runtimeExecutable": "${env:NVM_DIR}/nvm-exec",
import { expect } from 'chai';
import { stub, match } from 'sinon';
import { anonymousExample } from '../src/anonymous-example';
describe('anonymousExample()', () => {
beforeEach(() => {
stub(console, 'log');
});
it('should log first v when v is 1', () => {
export function anonymousExample(callbacker: (x: (v: number) => void) => void) {
callbacker((v) => {
if (v === 1) {
console.log('first v!');
} else {
console.log('another v!');
}
});
}
import { expect } from 'chai';
import { stub, match, SinonStub } from 'sinon';
import request = require('superagent');
import { superagentExample } from '../src/superagent-example';
describe('superAgentExample()', () => {
let send: SinonStub;
let set1: SinonStub;
let set2: SinonStub;
@Farenheith
Farenheith / superagent-example.spec.ts
Created February 29, 2020 06:22
Example of test to the first example of code in https://visionmedia.github.io/superagent/
import { expect } from 'chai';
import { stub, match } from 'sinon';
import request = require('superagent');
import { superagentExample } from '../src/superagent-example';
describe('superAgentExample()', () => {
let requestResult: request.SuperAgentRequest;
beforeEach(() => {
requestResult = Promise.resolve({ body: 'expected body' }) as any;
import { EventEmitter } from 'events';
import { expect } from 'chai';
import { stub } from 'sinon';
import { eventEmitterExample } from '../src/event-emitter-example';
describe.only('eventEmitterExample()', () => {
beforeEach(() => {
stub(console, 'info');
stub(console, 'error');
import { EventEmitter } from 'events';
export function eventEmitterExample(emitter: EventEmitter) {
emitter.on('somethingHappen', (x) => {
console.info(`Something happened! ${x}`);
});
emitter.on('sometingGoesWrong', (x) => {
console.error(`Something went wrong! ${x}`);
});
@Farenheith
Farenheith / not-so-simple-stream-example.spec.ts
Last active February 22, 2020 16:38
An example of tests of a function with stream and promises
import { expect } from 'chai';
import { stub, SinonStub, match } from 'sinon';
import * as zlib from 'zlib';
import { notSoSimpleStreamExample } from '../src/not-so-simple-stream-example';
import { ObjectReadableMock } from 'stream-mock';
describe('notSoSimpleStreamExample()', () => {
let data: any[] = [];
let gzip: SinonStub<any, any>;
@Farenheith
Farenheith / not-so-simple-stream-example.ts
Last active February 22, 2020 15:45
An eventier stream handler
import { Readable } from 'stream';
import { gzip } from 'zlib';
export async function notSoSimpleStreamExample(stream: Readable) {
return new Promise((resolve, reject) => {
const data: Array<Promise<Buffer>> = [];
stream.on('data', info => {
data.push(new Promise((resolve, reject) => {
gzip(info, (error, result) => {
if (error) {