Skip to content

Instantly share code, notes, and snippets.

View pokutuna's full-sized avatar
👁️
👄 👁 👂

pokutuna pokutuna

👁️
👄 👁 👂
View GitHub Profile
@pokutuna
pokutuna / Dockerfile
Last active April 20, 2026 03:26
Cloud Run L4 llama.cpp server with CUDA 12.8 compat
FROM --platform=linux/amd64 ghcr.io/astral-sh/uv:python3.13-bookworm-slim AS downloader
ARG MODEL_REPO
ARG MODEL_FILE
ENV HF_HUB_ENABLE_HF_TRANSFER=1
WORKDIR /models
RUN --mount=type=secret,id=HF_TOKEN,required=false \
HF_TOKEN=$(cat /run/secrets/HF_TOKEN 2>/dev/null || true) \
@pokutuna
pokutuna / cuda-img
Created April 18, 2026 04:11
cuda-img: find container images by CUDA env vars (PEP 723 + crane)
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "click",
# "httpx",
# ]
# ///
"""Find container images whose CUDA (or arbitrary env var) matches constraints.

LLM2025メインコンペ: SFT/DPO なしに基準点を超える試み

この課題は...プロンプトチューニングで解ける!!

最終課題のメインコンペは、Qwen3-4B-Instruct-2507 をベースに構造化出力 (JSON / YAML / TOML / XML / CSV) の生成精度を競うものです。入力に対して、指定されたフォーマットでデータを生成・変換し、構文の正しさとデータの内容で評価されます。

SFT や DPO でモデルの重みを更新して精度を上げるのが本来の解き方ですが、あえてこれらを行わず プロンプトチューニングで合格点ラインを超える試みを紹介します。

実際にこの方法で LB スコア 0.756 を達成できました。

#!/bin/bash
#
# Check that current Google models on Vertex AI work with the global endpoint.
#
# Usage:
# ./check_global_endpoint.sh PROJECT_ID
#
# Prerequisites:
# - gcloud CLI installed and authenticated
# - curl, jq
@pokutuna
pokutuna / sample.py
Created October 24, 2025 20:03
sample.py
import marimo
__generated_with = "0.17.1"
app = marimo.App()
@app.cell
def _():
import numpy as np
import matplotlib.pyplot as plt
@pokutuna
pokutuna / config-schema.json
Last active October 9, 2025 07:44
promptfoo config-schema.json with assertionTemplates support
{
"$ref": "#/definitions/PromptfooConfigSchema",
"definitions": {
"PromptfooConfigSchema": {
"type": "object",
"properties": {
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
description: "Simple repro"
prompts: "{{ prompt }}"
providers:
- file://script.py
tests:
- vars:
prompt: hello!
import asyncio
import logging
from pprint import pprint
from langchain_google_vertexai import ChatVertexAI
from langchain_mcp_adapters.client import MultiServerMCPClient
from langchain_mcp_adapters.tools import load_mcp_tools
from langgraph.prebuilt import create_react_agent
# Mute gemini unsupported schema warnings
@pokutuna
pokutuna / Dockerfile
Last active September 29, 2024 09:55
Label Studio & Litestream on Cloud Run | replace ******* to your setting
# syntax=docker/dockerfile:1
FROM heartexlabs/label-studio:latest
# https://github.com/HumanSignal/label-studio/blob/develop/Dockerfile
# Litestream
USER root
ENV LITESTREAM_VERSION=v0.3.13
RUN ARCH=$(case $(uname -m) in x86_64) echo 'amd64';; aarch64) echo 'arm64';; *) echo 'unsupported' && exit 1;; esac) \
&& curl -sL "https://github.com/benbjohnson/litestream/releases/download/${LITESTREAM_VERSION}/litestream-${LITESTREAM_VERSION}-linux-${ARCH}.deb" \
@pokutuna
pokutuna / main.go
Last active January 28, 2023 04:40
package main
import (
"flag"
"image"
"log"
"os"
_ "image/gif"
_ "image/jpeg"