Skip to content

#LLM

16 posts tagged LLM. All posts

  1. AI & dataImproving search results with a cross-encoder rerankerAdd a cross-encoder reranking step to embedding or BM25 retrieval with sentence-transformers, measure what it gains on real queries, and what it costs in latency.
  2. AI & dataMy esports betting tools: odds scrapers, LLM pickers and a live LoL win modelHow my esports betting repos work: a PlayNow odds scraper, LLM match pickers, and esports-odds-live, which prices live LoL games from op.gg data.
  3. AI & dataAI in Fall 2026: Gated Frontier Models, Computer Use and a Stateless MCPAnthropic, OpenAI and Google all shipped new model generations from September to November 2026. What changed, what got cheaper, and what it means for builders.
  4. InvestingAI Investing Research Systems: ai-berkshire and the Agents Built on BuffettHow ai-berkshire turns Claude Code into a four-analyst value investing team, how it compares with TradingAgents, and what research says about LLM stock picking.
  5. AI & dataProcessing thousands of prompts with the Claude Message Batches APIWhen the Message Batches API fits, and a script that submits a batch with custom IDs, polls it, reads the results and resubmits errored or expired requests.
  6. AI & dataHandling LLM API rate limits: retries, backoff and concurrency capsTell 429s from 529s and 5xx errors, use the Anthropic SDK's built-in retries, add backoff with jitter, and cap concurrency and input tokens with asyncio.
  7. AI & dataSemantic search in Postgres with pgvectorStore embeddings in Postgres with pgvector: vector columns, distance operators, HNSW and IVFFlat indexes, and filtered queries that still return enough rows.
  8. AI & dataStreaming LLM responses to the browser with server-sent eventsRelay a streamed Claude response through a FastAPI endpoint as server-sent events, read it in the browser with fetch, and handle proxy buffering and cancellation.
  9. AI & dataRunning local LLMs with Ollama and calling them from PythonInstall Ollama, pull and run open models, call them over the REST API, the ollama Python package and the OpenAI-compatible endpoint, and size context and memory.
  10. AI & dataChunking documents for retrieval: fixed size, recursive splits and headingsFour ways to chunk documents for RAG, from fixed windows to heading-aware splits, plus a small recall test that shows which one works for your embedding model.
  11. AI & dataCutting LLM costs with prompt caching in the Claude APIHow prefix caching works, where to put cache_control breakpoints, minimum lengths and TTLs, and how to read the cache usage fields to confirm you are getting hits.
  12. AI & dataBuilding an MCP server in Python with FastMCPWrite a Model Context Protocol server with the official Python SDK: tools, resources and prompts over stdio, tested with the Inspector and added to Claude Code.
  13. AI & dataA small eval runner for LLM features in PythonBuild a 160-line eval runner for an LLM feature: JSONL test cases, exact, regex and LLM-as-judge graders, concurrent runs and scores tracked per prompt version.
  14. AI & dataWriting a tool-use loop for the Claude API by handBuild the tool-calling loop for Claude yourself in Python: JSON Schema tools, the stop_reason loop, tool_result blocks, errors with is_error and a turn limit.
  15. AI & dataRetrieval-augmented generation from scratch with SQLiteBuild RAG in about 130 lines of Python: chunk Markdown, embed it locally, store vectors in SQLite, search by cosine similarity and get cited answers from Claude.
  16. AI & dataGetting reliable JSON from an LLM: schemas, structured outputs and validationThree ways to get JSON out of Claude in Python: prompting, a forced tool call and the structured outputs beta, with Pydantic validation, retries and stop reasons.

© 2026 David Li · Home · Blog · RSS ·Classic site · Built with Astro, Starlight and three.js · Logos:Font Awesome Free (CC BY 4.0)