Blog
Notes on things I'm building or trying to understand. Mostly ML, finance and Python.
-
2026-06Building a Parquet-backed data API, end to end
An HTTP API over a single Parquet file: polars scan_parquet per request, tests that never touch the real data, and a Railway deploy. Plus a follow-up to my last post, where the page cache that makes local reads fast turns out to be billed as memory.
[dev]
-
2026-04Digging Into Factor Modelling via Alternative Data
A start-to-finish tour of multi-factor modelling
[finance]
-
2026-04How to Add Login and a Paywall to a Streamlit App
Using Stripe + Streamlit for a simple paywalled application
[dev]
-
2026-04Why Reading Parquet from S3 Is Slow (Even In-Network) and What I Did Instead
S3 in-network reads still have a ~300ms latency floor. Downloading parquet files to ephemeral disk at startup gave me local-disk speeds (~3ms) for free on Railway.
[dev]
-
2026-01Optimising Query Transformations for Retrieval: A Negative Result
Could some form of derivative-free optimisation help with transforming retrieval queries for better RAG?
[ai]
-
2025-09Integrating Pydantic AI with Streamlit: Async Challenges and Fragment Optimisations
Trying to use Streamlit's nice chat UI with Pydantic AI
[dev]
-
2025-07Pydantic AI Output Validators: Runtime Validation with Dependencies
Using Pydantic AI's output validators for runtime validation that depends on context, with automatic retry handling when validation fails.
[ai]
-
2025-04Building a Caching System with FastHTML
Enable high performance dashboards/APIs by caching precomputed recent data.
[dev]
-
2025-04Stock Embeddings - Learning Distributed Representations for Financial Assets
Identifying meaningful relationships between the price movements of financial assets is a challenging but important problem in finance. While recent machine learning research often focuses on price forecasting, modeling asset correlations has lagged. Inspired by successes in natural language processing (NLP), we propose a neural model for training *stock embeddings*. This model uses historical returns data to learn nuanced relationships between financial assets. We describe our approach, discuss its potential applications, and present evaluation results demonstrating its utility in real-world financial analytics tasks compared to benchmarks.
[research]
-
2025-03Triggering Multiple Routes from a Single Form - FastHTML & HTMX
Using hx-trigger and hx-include to improve page load times etc.
[dev]
-
2020-10LSTM Networks | A Detailed Explanation
A Comprehensive Introduction to LSTMs. >100k views on Medium. Migrating to here after Toward Data Science moved away from Medium.
[research]