Skip to content

Instantly share code, notes, and snippets.

@dbreunig
dbreunig / ollama_speed_test.py
Created April 24, 2025 04:46
A quick script to measure the speed of all your downloaded models in Ollama.
import ollama
import csv
PROMPT = """
Read the following text and rephrase it in a more contemporary and casual manner:
The different accidents of life are not so changeable as the feelings
of human nature. I had worked hard for nearly two years, for the sole
purpose of infusing life into an inanimate body. For this I had
deprived myself of rest and health. I had desired it with an ardour
@dbreunig
dbreunig / chroma_dspy_demo.py
Last active September 1, 2025 08:51
Quickly building a tool-using DSPy module that leverages Chroma Cloud search.
import chromadb
import dspy
# Chose your LM. I'm using Qwen3-4B, hosted by LM Studio
lm = dspy.LM(
'openai/qwen_qwen3-4b-thinking-2507',
api_base="http://127.0.0.1:1234/v1",
api_key="blah",
max_tokens=262144
)