Skip to content

Instantly share code, notes, and snippets.

View maciejskorski's full-sized avatar

Maciej Skorski maciejskorski

View GitHub Profile
@maciejskorski
maciejskorski / download_OSF.sh
Created July 29, 2024 10:34
download files from OSF
# in bash; select the appropriate resource id and use the download api via wget
osf_id=cwu4m
wget --content-disposition "https://osf.io/$osf_id/download"
@maciejskorski
maciejskorski / README.md
Last active August 21, 2024 15:39
log detailed results in dbt clickhouse

Summary

The repo shows how to log run results in DBT with ClickHouse SQL.

The idea is to use on-run-end post-hook. The code logs detailed results data, including invocation arguments and timestamps.

This improves upon https://gist.github.com/jeremyyeo/064106e480106b49cd337f33a765ef20.

⚠️ recall that ClickHouse does not support schemas, so re-work qualified paths when using JINJA

@maciejskorski
maciejskorski / instructor_llm.py
Last active April 30, 2025 12:21
patching LLMs api for structured output with Instructor library
import instructor
from openai import OpenAI
from anthropic import Anthropic
from pydantic import BaseModel
class UserInfo(BaseModel):
field1: str
field2: int
# Initialize an AI client with various providers ....
@maciejskorski
maciejskorski / llama_modal.ipynb
Last active June 12, 2025 05:17
Fine-tuning LLMs on Modal.ai
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@maciejskorski
maciejskorski / claude_async.py
Created August 9, 2025 14:40
async processing with Anthropic
import anthropic
from tqdm.asyncio import tqdm as tqdm_async
async def analyze_with_claude(text: str, temperature=0.7):
client=anthropic.AsyncAnthropic()
output = await client.messages.create(
model="claude-4-sonnet-20250514",
max_tokens=200,
temperature=temperature,
system=prompt,