Skip to content

Instantly share code, notes, and snippets.

View kamilio's full-sized avatar
🇲🇽

Kamil Jopek kamilio

🇲🇽
View GitHub Profile
@kamilio
kamilio / INKLING_REASONING_EFFORT_VERCEL.md
Last active July 17, 2026 20:36
Inkling reasoning effort appears ineffective through Vercel AI Gateway

Inkling reasoning effort through Vercel AI Gateway

Neither reasoning_effort nor Vercel's reasoning.effort object shows reliable effort scaling for thinkingmachines/inkling through Vercel AI Gateway.

Thinking Machines documents reasoning_effort for its OpenAI-compatible Chat Completions API and maps low to 0.2 and xhigh to 0.99. It also warns that individual samples are stochastic, so this reproduction compares multiple samples with enough output headroom to avoid truncation.

@kamilio
kamilio / kimi_k3_vercel_web_search_repro.mjs
Created July 17, 2026 20:13
Repro: Vercel AI Gateway rejects Kimi K3 documented builtin_function $web_search tool
// npm install openai
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.VERCEL_API_KEY,
baseURL: "https://ai-gateway.vercel.sh/v1",
});
const completion = await client.chat.completions.create({
model: "moonshotai/kimi-k3",
@kamilio
kamilio / muse_spark_headlines_responses.mjs
Last active July 14, 2026 17:48
Muse Spark 1.1 Responses API: today headlines via Vercel AI Gateway vs Meta 1P, forced high reasoning
const response = await fetch("https://ai-gateway.vercel.sh/v1/responses", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.VERCEL_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "meta/muse-spark-1.1",
input: "What are today's headlines?",
reasoning: { effort: "high", summary: "detailed" },
@kamilio
kamilio / README.md
Last active March 20, 2026 14:24
Repro: /v1/responses returns invalid output_text for Google models (missing text field on tool calls)

How to run

npm init -y && npm install ai @ai-sdk/openai zod tsx
POE_API_KEY=your-key npx tsx poe-repro.ts

Bug

/v1/responses returns invalid output_text for Google models when making tool calls:

@kamilio
kamilio / package.json
Last active February 20, 2026 16:12
Poe Opus 4.6 test scripts and package.json
{
"name": "investigation-scripts",
"version": "1.0.0",
"description": "",
"main": "test_poe_opus46_anthropic.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
@kamilio
kamilio / repro-responses-google-nano-banana.mjs
Created February 3, 2026 16:10
Repro: AI SDK Responses via Poe API (google/nano-banana)
// Repro: AI SDK (OpenAI Responses) calling Poe API (google/nano-banana)
//
// Install (in an empty repo):
// npm i ai @ai-sdk/openai
//
// Run:
// node --env-file=.env tests/scripts/repro-responses-google-nano-banana.mjs
// or:
// POE_API_KEY=your_key node tests/scripts/repro-responses-google-nano-banana.mjs
@kamilio
kamilio / test-prompt-caching.mjs
Last active February 2, 2026 17:10
Test Anthropic prompt caching via Poe API
// Test prompt caching with Anthropic SDK via Poe API
//
// Run:
// node --env-file=.env tests/scripts/test-prompt-caching.mjs
// or:
// POE_API_KEY=your_key node tests/scripts/test-prompt-caching.mjs
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
@kamilio
kamilio / custom-thunk.js
Created May 10, 2016 16:08
Redux, eventBus solved with middlewares or without
// *** Middleware - custom thunk implementation (slightly diffferent though) - maybe more scalable appraoch
export default function createEventBusMiddleware(eventBus) {
return ({ dispatch, getState }) => (next) => (action) => {
// we could optimize further here and use rest operator to get all arguments and compose the middlewares
if (typeof action === 'function') {
return action({ dispatch, eventBus, getState });
}
return next(action);
};
@kamilio
kamilio / programmingWithFunctions.js
Last active August 29, 2015 14:19
Programming with Functions - Stuttgart JS Meetup
// ***************************
// Programming with functions (Kamil Jopek)
// Stuttgart JS Meetup Talk (13th April 2015)
// ***************************
// Basic functions
var add = function(a, b) {
return a + b;
};

How to configure gems

Are you writing a new gem and you are not sure how to let user configure it? Here is a short gist to show you how to do it. I like this style of configurations, inspired by many already existing gems such as Devise, Airbrake, PDFkit and many more.

# Configuration
MyShinyGem.configure do |config|
  config.binary = '/bin/ls'
 config.username = 'superuser'