Skip to content

Instantly share code, notes, and snippets.

View vkryukov's full-sized avatar

Victor vkryukov

  • Sunnyvale, CA
  • 05:30 (UTC -08:00)
View GitHub Profile
@vkryukov
vkryukov / reqllm_v2_analysis.md
Created January 23, 2026 02:58
ReqLLM v2 analysis

ReqLLM v2 Analysis (Design Alternatives)

This gist summarizes the comparison between ReqLlmNext (metadata‑driven spike) and the current ReqLLM v1, plus a recommended v2 simplification path.


1) What ReqLlmNext Simplifies

  • Central pipeline clarity: Resolver → Validation → Constraints → Adapter → Wire → Provider.
  • Metadata-driven model expansion: adding models via LLMDB updates is genuinely faster.
from __future__ import annotations
import base64
from openai import OpenAI
PDF_CONTENT = b"""%PDF-1.4
1 0 obj << /Type /Catalog /Pages 2 0 R >> endobj
2 0 obj << /Type /Pages /Kids [3 0 R] /Count 1 >> endobj
3 0 obj << /Type /Page /Parent 2 0 R /MediaBox [0 0 612 792] /Contents 4 0 R /Resources << /Font << /F1 5 0 R >> >> >> endobj
@vkryukov
vkryukov / pdf_attachment_issue.exs
Last active January 8, 2026 01:21
Script demonstrating PDF attachment support across different LLM providers (ReqLLM)
# Script demonstrating PDF attachment support across different LLM providers
#
# Run with: mix run scripts/pdf_attachment_issue.exs
#
# Issue: ReqLLM encodes :file content parts as `image_url` type, but some
# providers (like OpenAI) only accept image formats in image_url content parts.
#
# The encoding happens in deps/req_llm/lib/req_llm/provider/defaults.ex:651-666
alias ReqLLM.{Context, Message}
@vkryukov
vkryukov / claude-opus-45-images-plan.md
Last active December 17, 2025 16:19
ReqLLM image support plans

Image Generation Support - Architecture and Implementation Plan

Overview

This document outlines the architecture and implementation plan for adding image generation support to ReqLLM, following the library's established patterns for operation-based dispatch and provider abstraction.

Goals

  1. Add first-class image generation support with generate_image/3 and generate_image!/3 functions
  2. Support OpenAI (DALL-E) and Google (Gemini) as initial providers
# This script demonstrates the difference in behavior when using tools with
# streaming vs regular calls.
alias ReqLLM.Context
{:ok, planet_weather_tool} =
ReqLLM.Tool.new(
name: "planet_weather",
description: "Gets weather on a planet",
parameter_schema: [planet: [type: :string, required: true]],
@vkryukov
vkryukov / 20251020-17-16-s0ix-output.log
Created October 20, 2025 17:44
S0ix Selftest Result
---Check S2idle path S0ix Residency---:
The system OS Kernel version is:
Linux localhost-live 6.14.0-63.fc42.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Mar 24 19:53:37 UTC 2025 x86_64 GNU/Linux
---Check whether your system supports S0ix or not---:
The acpidump tool is needed to check whether low idle S0
capability is enabled on the test platform, please install acpica-tools
or check if the acpidump command execution failed.
@vkryukov
vkryukov / claude code - opus 4.1
Last active August 26, 2025 00:40
OpenAI.Response 0.7.0 improvement ideas using various CLI tools (Claude Code, Codex, Gemini)
Based on my analysis of your library, here are comprehensive improvement suggestions organized by priority and impact:
🎯 High Priority Improvements
1. Enhanced Error Handling & Resilience
- Add automatic retry with exponential backoff for transient failures (429, 500, 503 errors)
- Implement circuit breaker pattern to prevent cascading failures
- Add configurable timeout strategies per operation type
- Provide better error context with request details in errors
@vkryukov
vkryukov / codex_beam_bootstrap.sh
Last active September 18, 2025 08:49
Installing Elixir/Erlang on Codex
#!/usr/bin/env bash
###############################################################################
# codex_beam_bootstrap.sh ─ OTP 27 + Elixir 1.18 behind Codex MITM proxy
###############################################################################
go install github.com/asdf-vm/asdf/cmd/asdf@v0.18.0
asdf plugin add erlang https://github.com/michallepicki/asdf-erlang-prebuilt-ubuntu-24.04.git || true
asdf plugin add elixir
asdf install erlang 27.3.4
asdf set -u erlang 27.3.4
@vkryukov
vkryukov / digits.py
Last active October 13, 2019 18:37
Arithmetic puzzle solver
"""
Arithmetic puzzle solver. You are given a sequence of four digits, say 1,2,3,4,
and your job is to combine them with ordinary arithmetic operations (+, -, ×, and ÷)
in any order to make a target number. E.g. 24 = 1 * 2 * 3 * 4 or 24 = (1 + 2 + 3) * 4.
Some 'hard' problems from https://blog.plover.com/math/17-puzzle.html:
1. Given 6, 6, 5, 2, get 17.
2. Given 3, 3, 8, 8, get 24.
"""
@vkryukov
vkryukov / digits2.go
Created December 4, 2014 20:25
1989 solution - version #2
package main
import (
"fmt"
"log"
"math"
"os"
"sort"
"strconv"
"strings"