HNHacker News
TopNewBestAskShowJobs

apwheele

1,910 karma · joined November 10, 2021

Data scientist. Former academic in criminal justice field.

Personal blog at https://andrewpwheeler.com/

Consulting at https://crimede-coder.com/

Large Language Models for Mortals: A Practical Guide for Analysts (book), https://crimede-coder.com/blogposts/2026/LLMsForMortals

submissionscomments
apwheele··on Large Language Models for Mortals: A Practical Guide for Analysts with Python
IMO Google Vertex is not any harder than AWS. AWS biggest pain is figuring out IAM roles for some of the services (batching and S3 Vectors -- I actually cut out Knowledge Bases in the book because it was too complicated and expensive). Have not personally had as big an issue figuring out Vertex.

I do have a follow up post planned on some reliability issues with the APIs I uncovered with compiling the book so much -- I would not use Google Maps grounding in production!

apwheele··on Large Language Models for Mortals: A Practical Guide for Analysts with Python
I am not as concerned with that with API usage as I am with the GUI tools.

Most of the day gig is structured extraction and agents, which the foundation LLMs are much better than any of the small models. (And I would not be able to provision necessary compute for large models given our throughput.)

I do have on the ToDo list though evaluating Textract vs the smaller OCR models (in the book I show using docling, their are others though, like the newer GLM-OCR). Our spend for that on AWS is large enough and they are small enough for me to be able to spin up resources sufficient to meet our demand.

Part of the reason the book goes through examples with AWS/Google (in additiona to OpenAI/Anthropic) is that I suspect many individuals will be stuck with the cloud provider that their org uses out of the box. So I wanted to have as wide of coverage as possible for those folks.

apwheele··on Large Language Models for Mortals: A Practical Guide for Analysts with Python
You can use `LLMDEVS` for 50% off of epub (that was the coupon I sent to folks on my newsletter).
apwheele··on Large Language Models for Mortals: A Practical Guide for Analysts with Python
Totally agree it is critical. Each of chapters 4/5/6 have specific sections demonstrating testing. For structured outputs it goes through an example ground truth and calculating accuracy, demoing an example comparing Haiku 3 vs 4.5.

For Chapter 5 on RAG, it goes through precision/recall (with emphasis typically on recall for RAG systems).

For Chapter 6, I show a demo of LLM as a judge (using structured outputs to have specific errors it looks for) to evaluate a more fuzzy objective (writing a report based on table output).

apwheele··on Rolling your own serverless OCR in 40 lines of code
Question for the crowd -- with autoscaling, when a new pod is created it will still download the model right from huggingface?

I like to push everything into the image as much as I can. So in the image modal, I would run a command to trigger downloading the model. Then in the app just point to the locally downloaded model. So bigger image, but do not need to redownload on start up.

apwheele··on Ask HN: What are you working on? (February 2026)
Just released a new book on using the foundation model APIs, https://crimede-coder.com/blogposts/2026/LLMsForMortals, Large Language Models for Mortals: A Practical Guide for Analysts with Python.

Up to date and has examples for all of the major foundation model providers (OpenAI, Anthropic, Google, and AWS Bedrock). Goes through basics of calling the API, structured outputs, RAG, and MCP/Agents. Also has a chapter on the LLM coding tools (Copilot, Claude Code, and Antigravity).

apwheele··on Mermaid ASCII: Render Mermaid diagrams in your terminal
In the live demo, I am confused about some of the ascii renderings. (Unless I am missing something, they appear incorrect/inconsistent with the SVG.), https://agents.craft.do/mermaid

So for the "All Edge styles"

    graph TD
      A[Source] -->|solid| B[Target 1]
      A -.->|dotted| C[Target 2]
      A ==>|thick| D[Target 3]
Results in the ascii

    ┌──────────┐                                     
    │          │                                     
    │  Source  ├─thickted─────┐                      
    │          │        │     │                      
    └─────┬────┘        └─────┼────────────────┐     
          │                   │                │     
          │                   │                │     
        solid                 │                │     
          │                   │                │     
          ▼                   ▼                ▼     
    ┌──────────┐        ┌──────────┐     ┌──────────┐
    │          │        │          │     │          │
    │ Target 1 │        │ Target 2 │     │ Target 3 │
    │          │        │          │     │          │
    └──────────┘        └──────────┘     └──────────┘
(The svg for this example is maybe misleading, as it looks like un upside down T) But the ascii here has the overlapping words, and you cannot tell the difference in any of the lines.

The Parallel links, example mermaid

    graph TD
      A[Input] & B[Config] --> C[Processor]
      C --> D[Output] & E[Log]
results in ascii

    ┌───────────┐     ┌────────┐
    │           │     │        │
    │   Input   │     │ Config │
    │           │     │        │
    └─────┬─────┘     └────┬───┘
          │                │    
          │                │    
          │                │    
          │                │    
          ▼                │    
    ┌───────────┐          │    
    │           │          │    
    │ Processor ├◄─────────┤    
    │           │          │    
    └─────┬─────┘          │    
          │                │    
          │                │    
          │                │    
          │                │    
          ▼                ▼    
    ┌───────────┐     ┌────────┐
    │           │     │        │
    │   Output  │     │  Log   │
    │           │     │        │
    └───────────┘     └────────┘
This is just wrong isn't it? Why is there an arrow from config to log?
apwheele··on Anyone Can Clone Your Voice Now
I would clone my own and do things like create scripted tutorials/presentations and audio books.

I do not personally prefer it, but a non-trivial number of individuals like video/audio presentations over writing.

apwheele··on Targeted Bets: An alternative approach to the job hunt
I generally do not agree with this advice (or you can do both, cold emailing folks should not prevent you from cold applying to other jobs). It really just hinges on what you think your probability increase is relative to the amount of time you spend, https://crimede-coder.com/news/Post004.
apwheele··on Launch a Debugging Terminal into GitHub Actions
I only have pretty tame actions workflows and I have had a hard time replicating simple set ups with this. I can't imagine a company with more complicated setups.

What I wish is github codespaces could just do this out of the box, at least for a specific action/runner.

apwheele··on Standard Ebooks: Public Domain Day 2026 in Literature
Oh to be clear, these are books I own the copyright to (published through my own imprint).
apwheele··on Standard Ebooks: Public Domain Day 2026 in Literature
Off topic, but one thing I wish I could do is donate a single copy epub I have the rights to to all libraries. It should be technically possible (many of the places I have lived the local library uses Overdrive).
apwheele··on I canceled my book deal
The such low royalties make folks seriously consider self-publishing if you think you can get any sales. (And if you do not need a copy-editor.)

So I have only around 150 sales of my book (see notes at https://andrewpwheeler.com/2024/07/02/some-notes-on-self-pub...). I make around ~$30 though net (average between on-demand print and epub). So my measly sales are about the same as the advance here (not clear if this was ever paid out, presume they would get it back if it was paid out).

If you really think you can sell thousands of copies the economics of it really should hit you.

I get going through a publisher will increase sales, but if you have a popular platform already to advertise it (like a blog or other popular social media), I just don't get it.

apwheele··on Coursera to combine with Udemy
Yeah ditto. I don't know when it happened, but the Coursera courses I tried at first (around 2012 I think?) were very high quality -- I thought it was clearly a competitor to traditional brick and mortar.

Then a few years later, checked it out and there were thousands of courses, many clearly without as much thought or effort.

I am not as familiar with the other online schools that focus on quality (like WGU). I am surprised they have not eaten traditional schools lunches, since the actual quality of instruction is often very variable (I am a former professor, for the most part profs have little oversight in how they run classes). Market for lemons maybe?

Another aspect I am surprised at is that the big companies have not just started their own schools. UT-Dallas where I was at for a few years was basically started to help train up folks for Texas Instruments. (RAND Pardee school is kind-of an exemplar, although that is not focused on software engineering.)

I debate sometimes I shouldn't bother with hiring seniors and just train up everyone. If you have 10k software engineers does it not make sense to just have that level of training internally?

apwheele··on No more O'Reilly subscriptions for me
Do folks have opinions on the quality of the recent books? Last one I picked up was not good (good chance it is partially AI slop).

Read online (and not in the app), but the copy-editing did not do it any favors, and then how code snippets were formed broke the simple copy/paste (used icons for line breaks that could have been avoidable).

apwheele··on WebR – R in the Browser
When you want to run stuff client side instead of your server is one question to determine.

For R specifically, it is focused on stats/graphing. So if you wanted an app where someone could upload data and fit a complicated regression model, this would be a good use case. (There are probably javascript libraries for regression, but if willing to live with the bit of start up lag, worth it for anything mildly complicated -- factors in R for example would not like to worry about writing my own code in javascript to make the design matrix.)

In the case where you run the server, the data has to travel to your server, your computer estimates the model, and it sends it back. WASM apps this all happens client side.

It is a good use case for dynamic graphs/dashboards as well. If the data is small enough to entirely fit in memory, can basically have a local interactive session with the data and everything will be quite snappy (do not need to continually go back and forth with your server to query data).

apwheele··on Writing a book with Quarto
I used quarto for my book as well and have a write up, https://andrewpwheeler.com/2024/07/02/some-notes-on-self-pub...

One nice thing about Quarto, is that I could have different fonts and formatting niceties for the epub vs PDF version (which the PDF version is the one I use to sell a paperback copy).

Additionally wrote a little script to auto-translate the contents from the markdown, so currently have the book available in Spanish and French as well.

apwheele··on Randomness Testing Guide
I don't know what NIST says, but for the tests that use Chi-square, you can look at the left tail. Basically tests that have very small Chi-square values are "too close" to the expected distribution.

This is how Fisher critiqued Mendel's experiments -- they were too perfect!

apwheele··on Judge denies request to exempt Flock footage from Public Records Act
For the more specific part that the PD states it does not physically save the data locally, I do work with cities Police departments and Flock will integrate with the local record management system.

I suspect they probably do have the data locally integrated (at least for the time period the state allows them to retain the records). But even if they do not, many police departments that would not be an excuse (although you need to request fast, many states only retain for 30 days or less now).

apwheele··on KaTeX – The fastest math typesetting library for the web
This is very obnoxious when transferring documents from Gemini to google docs (and not just math, tables/code sections are often not transferred correctly as well).

I have a javascript hack from the dev console where I can at least print the chat to PDF, https://andrewpwheeler.com/2025/08/28/deep-research-and-open... (that at least worked 2 months ago)

apwheele··on Use DuckDB-WASM to query TB of data in browser
For a demo of this (although not sure with duckdb wasm that it works with iceberg) https://andrewpwheeler.com/2025/06/29/using-duckdb-wasm-clou...
apwheele··on It's insulting to read AI-generated blog posts
I do remember 1 example of an emoji in tech docs before all of this -- learning github actions (which based on my blog happened in 2021 for me, before ChatGPT release), at one point they had an apple emoji at the final stage saying "done". (I am sure there are others, I just do not remember them.)

But agree excessive emoji's, tables of things, and just being overly verbose are tells for me anymore.

apwheele··on Generalized K-Means Clustering
Can folks comment on what applications they use k-means for? It was a basic technique I learned in school, but honestly I am not really familiar with a single use case that is very clearly motivated besides "pretty pictures".

So I do a bit of work in geospatial analysis, and hotspots are better represented by DBSCAN (do not need to assign every point a cluster). I just do not even use clustering very often in gig (supervised ML and anomaly detection are much more prevalent in the rest of my work).

apwheele··on Evanston orders Flock to remove reinstalled cameras
You might reach out to the folks at the Institute for Justice, they have written letters to the cities to get the cameras taken down in these scenarios, https://ij.org/press-release/victory-arkansas-city-moves-sur...
apwheele··on Reloading Classes in Python
Oh nice, thank you for that tip. I was doing the opposite, `new_obj = mod.Class(...)` and then assigning the dicts from the old object (which was when I realized the pickle save/load was easier).
apwheele··on WebR – R in the Browser
Here is my take -- if you wanted some sort of app that required complicated regression modelling to happen client side (and the data is not crazy big), this would be a decent option. So you just serve the html + javascript files, and client side computer does all the hard work.

Say a forecasting tool (pull down data dynamically, and then it auto-generates a forecast). Or smooth out some other noisy data and display in graphics.

There are probably a smattering of other current javascript libraries, but many complicated things will be supported right out of the box with this. (Looks to me they just compiled most packages on CRAN, I can install my R package I have mostly not touched in several years.)

apwheele··on Sunny days are warm: why LinkedIn rewards mediocrity
I don't disagree with the fundamentals of the post (most stuff is vapid, not just on LinkedIn but other platforms as well). But I still personally have benefitted the most from LinkedIn for grass roots for my business most recently, https://andrewpwheeler.com/2025/02/20/linkedin-is-the-best-s.... It is higher quality referrals than I ever got from X for example.
apwheele··on Simulating and Visualising the Central Limit Theorem
I mean, for the main simulation I would do it like this:

    set.seed(10)
    n <- 10000; samp_size <- 60
    df <- data.frame(
        uniform = runif(n, min = -20, max = 20),
        normal = rnorm(n, mean = 0, sd = 4),
        binomial = rbinom(n, size = 1, prob = .5),
        beta = rbeta(n, shape1 = .9, shape2 = .5),
        exponential = rexp(n, .4),
        chisquare = rchisq(n, df = 2)
    )
    
    sf <- function(df,samp_size){
        sdf <- df[sample.int(nrow(df),samp_size),]
        colMeans(sdf)
    }
    
    sim <- t(replicate(20000,sf(df,samp_size)))
I am old, so I do not like tidyverse either -- I can concede it is of personal preference though. (Personally do not agree with the lattice vs ggplot comment for example.)
apwheele··on Live coding interviews measure stress, not coding skills
These are 100% people who claim to be senior ICs with years of developer experience in python. The resume thing that list being expert in dozens of libraries, etc.

It is even less tricky than you are thinking. I literally just want them to know you need to put in a `hw.py` file `print("hello world")`, and then run from the command line `python hw.py`.

The reasons for failure are myriad (I suppose you could say it is they do not understand, but I legit try, regularly spend 10-20 minutes on just this for the ones who have problems, I am not being tricky). A few are people who do not know file systems (save their `.py` file in a wrong location), a few I think just do work in environments like served jupyter notebooks so don't have any relevant software dev experience (don't know how to execute python directly or write code in a .py file), some I am pretty sure are just liars on their expertise (have a few that just leave interview when asked this question).

apwheele··on Live coding interviews measure stress, not coding skills
The rub is the take home assignments are not good either.

I do personally let people pass the tech if they have good open source work (a good tech blog, legit python repo's, not just trivial homework stuff they did in school). So few of people have that though.

← PreviousPage 3 of 8Next →