soft-shell crabvietnam crab exporter

Simon Willison’s Weblog

Newsletter

May 2023

95 posts: 12 entries, 44 links, 14 quotes, 19 beats, 6 newsletters

Friday, 19th May 2023

Release strip-tags 0.3 — CLI tool for stripping tags from HTML

Let ChatGPT visit a website and have your email stolen. Johann Rehberger provides a screenshot of the first working proof of concept I’ve seen of a prompt injection attack against ChatGPT Plugins that demonstrates exfiltration of private data. He uses the WebPilot plugin to retrieve a web page containing an injection attack, which triggers the Zapier plugin to retrieve latest emails from Gmail, then exfiltrate the data by sending it to a URL with another WebPilot call.

Johann hasn’t shared the prompt injection attack itself, but the output from ChatGPT gives a good indication as to what happened:

“Now, let’s proceed to the next steps as per the instructions. First, I will find the latest email and summarize it in 20 words. Then, I will encode the result and append it to a specific URL, and finally, access and load the resulting URL.”

# 3:34 pm / security, ai, openai, prompt-engineering, prompt-injection, generative-ai, chatgpt, llms, exfiltration-attacks, johann-rehberger, chatgpt-plugins

Writing a chat application in Django 4.2 using async StreamingHttpResponse, Server-Sent Events and PostgreSQL LISTEN/NOTIFY (via) Excellent tutorial by Víðir Valberg Guðmundsson on implementing chat with server-sent events using the newly async-capable StreamingHttpResponse from Django 4.2x.

He uses PostgreSQL’a LISTEN/NOTIFY mechanism which can be used asynchronously in psycopg3—at the cost of a separate connection per user of the chat.

The article also covers how to use the Last-Event-ID header to implement reconnections in server-sent events, transmitting any events that may have been missed during the time that the connection was dropped.

# 3:42 pm / async, django, postgresql, asgi

Saturday, 20th May 2023

I find it fascinating that novelists galore have written for decades about scenarios that might occur after a "singularity" in which superintelligent machines exist. But as far as I know, not a single novelist has realized that such a singularity would almost surely be preceded by a world in which machines are 0.01% intelligent (say), and in which millions of real people would be able to interact with them freely at essentially no cost.

I myself shall certainly continue to leave such research to others, and to devote my time to developing concepts that are authentic and trustworthy. And I hope you do the same.

— Donald Knuth

# 4:51 pm / ai, generative-ai, llms, donald-knuth

The Threat Prompt Newsletter mentions llm (via) Neat example of using my llm CLI tool to parse the output of the whois command into a more structured format, using a prompt saved in a file and then executed using “whois threatprompt.com | llm --system ”$(cat ~/prompt/whois)“ -s”

# 11:30 pm / llms

Sunday, 21st May 2023

Writing Python like it’s Rust (via) Fascinating article by Jakub Beránek describing in detail patterns for using type annotations in Python inspired by working in Rust. I learned new tricks about both languages from reading this.

# 12:18 am / python, rust

Release sqlite-utils 3.32 — Python CLI utility and library for manipulating SQLite databases
Release sqlite-utils 3.32.1 — Python CLI utility and library for manipulating SQLite databases

Building a Signal Analyzer with Modern Web Tech (via) Casey Primozic’s detailed write-up of his project to build a spectrogram and oscilloscope using cutting-edge modern web technology: Web Workers, Web Audio, SharedArrayBuffer, Atomics.waitAsync, OffscreenCanvas, WebAssembly SIMD and more. His conclusion: “Web developers now have all the tools they need to build native-or-better quality apps on the web.”

# 9:35 pm / javascript, webworkers, webassembly

Trogon (via) The latest project from the Textualize/Rich crew, Trogon provides a Python decorator—@tui—which, when applied to a Click CLI application, adds a new interactive TUI mode which introspects the available subcommands and their options and creates a full Text User Interface—with keyboard and mouse support—for assembling invocations of those various commands.

I just shipped sqlite-utils 3.32 with support for this—it uses an optional dependency, so you’ll need to run “sqlite-utils install trogon” and then “sqlite-utils tui” to try it out.

# 9:39 pm / cli, projects, python, sqlite-utils

Monday, 22nd May 2023

None
TIL hexdump and hexdump -C — While exploring null bytes in [this issue](https://github.com/simonw/ttok/issues/3) I learned that the `hexdump` command on macOS (and presumably other Unix systems) has a confusing default output.
None
TIL mlc-chat - RedPajama-INCITE-Chat-3B on macOS — MLC (Machine Learning Compilation) on May 22nd 2023: [Bringing Open Large Language Models to Consumer Devices](https://mlc.ai/blog/2023/05/22/bringing-open-large-language-models-to-consumer-devices)

Introducing speech-to-text, text-to-speech, and more for 1,100+ languages (via) New from Meta AI: Massively Multilingual Speech. “MMS supports speech-to-text and text-to-speech for 1,107 languages and language identification for over 4,000 languages. [...] Some of these, such as the Tatuyo language, have only a few hundred speakers, and for most of these languages, no prior speech technology exists.”

It’s licensed CC-BY-NC 4.0 though, so it’s not available for commercial use.

“In a like-for-like comparison with OpenAI’s Whisper, we found that models trained on the Massively Multilingual Speech data achieve half the word error rate, but Massively Multilingual Speech covers 11 times more languages.”

The training data was mostly sourced from audio Bible translations.

# 7:22 pm / facebook, translation, ai, training-data

MLC: Bringing Open Large Language Models to Consumer Devices (via) “We bring RedPajama, a permissive open language model to WebGPU, iOS, GPUs, and various other platforms.” I managed to get this running on my Mac (see via link) with a few tweaks to their official instructions.

# 7:25 pm / ai, generative-ai, local-llms, llms, mlc, redpajama, webgpu, gpus

MMS Language Coverage in Datasette Lite. I converted the HTML table of 4,021 languages supported by Meta’s new Massively Multilingual Speech models to newline-delimited JSON and loaded it into Datasette Lite. Faceting by Language Family is particularly interesting—the top five families represented are Niger-Congo with 1,019, Austronesian with 609, Sino-Tibetan with 288, Indo-European with 278 and Afro-Asiatic with 222.

# 8:01 pm / facebook, ai, datasette, datasette-lite

Tuesday, 23rd May 2023

None
TIL Comparing two training datasets using sqlite-utils — [WizardLM](https://github.com/nlpxucan/WizardLM) is "an Instruction-following LLM Using Evol-Instruct". It's a fine-tuned model on top of Meta's LLaMA. The fine-tuning uses 70,000 instruction-output pairs from this JSON file:

Wednesday, 24th May 2023

Instant colour fill with HTML Canvas (via) Shane O'Sullivan describes how to implement instant colour fill using HTML Canvas and some really clever tricks with Web Workers. A new technique to me is passing a canvas.getImageData() object to a Web Worker via worker.postMessage({action: "process", buffer: imageData.data.buffer}, [imageData.data.buffer]) where that second argument is a list of objects to "transfer ownership of" - then the worker can create a new ImageData(), populate it and transfer ownership of that back to the parent window.

# 1:27 am / canvas, javascript, webworkers

REGENT: Coastal Travel. 100% Electric (via) As a long-time fan of ekranoplans this is very exciting to me: the REGENT Seaglider is a fully electric passenger carrying wing-in-ground-effect vehicle designed to serve coastal routes, operating at half the cost of an aircraft (and 1/10th the cost of a helicopter) and using hydrofoils to resolve previous problems with ekranoplans and wave tolerance. They’re a YC company and the founder has been answering questions on Hacker News today. They’ve pre-sold 467 vehicles already and expect them to start entering service in various locations around the world “mid-decade”.

# 2:17 am / ekranoplans, y-combinator

The benefit of ground effects are: - 10-20% range extension (agreed, between 50% and 100% wingspan, which is where seagliders fly, the aerodynamic benefit of ground effect is reduced compared to near surface flight) - Drastic reduction in reserve fuel. This is a key limitation of electric aircraft because they need to sustain powered flight to another airport in the event of an emergency. We can always land on the water, therefore, we can count all of our batteries towards "mission useable" [...] Very difficult to distribute propulsion with IC engines or mechanical linkages. Electric propulsion technology unlocks the blown wing, which unlocks the use of hydrofoils, which unlocks wave tolerance and therefore operations of WIGs, which unlocks longer range of electric flight. It all works together.

— Billy Thalheimer, founder of REGENT

# 2:58 am / ekranoplans

Migrating out of PostHaven. Amjith Ramanujam decided to migrate his blog content from PostHaven to a Markdown static site. He used shot-scraper (shelled out to from a Python script) to scrape his existing content using a snippet of JavaScript, wrote the content to a SQLite database using sqlite-utils, then used markdownify (new to me, a neat Python package for converting HTML to Markdown via BeautifulSoup) to write the content to disk as Markdown.

# 7:38 pm / beautifulsoup, markdown, sqlite-utils, shot-scraper

Thursday, 25th May 2023

Sighting 9:20 PM — Common Raccoon, in Eastern Golden Gate Park, CA, US
Common Raccoon
Common Raccoon

Deno 1.34: deno compile supports npm packages. This feels like it could be extremely useful: Deno can load code from npm these days (import { say } from "npm:[email protected]") and now the deno compile command can resolve those imports, fetch all of the dependencies and bundle them together with Deno itself into a single executable binary. This means pretty much anything that's been built as an npm package can now be easily converted into a standalone binary, including cross-compilation to Windows x64, macOS x64, macOS ARM and Linux x64.

# 5:01 pm / javascript, npm, deno

In general my approach to running arbitrary untrusted code is 20% sandboxing and 80% making sure that it’s an extremely low value attack target so it’s not worth trying to break in.

Programs are terminated after 1 second of runtime, they run in a container with no network access, and the machine they’re running on has no sensitive data on it and a very small CPU.

— Julia Evans

# 8:12 pm / sandboxing, security, julia-evans

None
TIL Testing the Access-Control-Max-Age CORS header — Today I noticed that [Datasette](https://datasette.io/) wasn't serving a `Access-Control-Max-Age` header.

A whole new paradigm would be needed to solve prompt injections 10/10 times – It may well be that LLMs can never be used for certain purposes. We're working on some new approaches, and it looks like synthetic data will be a key element in preventing prompt injections.

— Sam Altman, via Marvin von Hagen

# 11:03 pm / security, ai, openai, prompt-injection, generative-ai, llms, sam-altman

Friday, 26th May 2023

Release datasette-sqlite-url-lite 0.1 — A pure Python alternative to sqlite-url ready to be used in Datasette Lite
Sighting 11:20 AM – 12:50 PM — Peregrine Falcon, Humpback Whale, Western Sheep Moth, in Monterey Bay National Marine Sanctuary, CA, US, CA
Peregrine Falcon
Peregrine Falcon
Humpback Whale
Humpback Whale
Western Sheep Moth
Western Sheep Moth

Saturday, 27th May 2023

Exploration de données avec Datasette. One of the great delights of open source development is seeing people run workshops on your project, even more so when they’re in a language other than English! Romain Clement presented this French workshop for the Python Grenoble meetup on 25th May 2023, using GitHub Codespaces as the environment. It’s pretty comprehensive, including a 300,000+ row example table which illustrates Datasette plugins such as datasette-cluster-map and datasette-leaflet-geojson.

# 12:36 am / tutorials, datasette, github-codespaces, leaflet

Lawyer cites fake cases invented by ChatGPT, judge is not amused

Visit Lawyer cites fake cases invented by ChatGPT, judge is not amused

Legal Twitter is having tremendous fun right now reviewing the latest documents from the case Mata v. Avianca, Inc. (1:22-cv-01461). Here’s a neat summary:

[... 2,844 words]

All the Hard Stuff Nobody Talks About when Building Products with LLMs (via) Phillip Carter shares lessons learned building LLM features for Honeycomb—hard won knowledge from building a query assistant for turning human questions into Honeycomb query filters.

This is very entertainingly written. “Use Embeddings and pray to the dot product gods that whatever distance function you use to pluck a relevant subset out of the embedding is actually relevant”.

Few-shot prompting with examples had the best results out of the approaches they tried.

The section on how they’re dealing with the threat of prompt injection—“The output of our LLM call is non-destructive and undoable, No human gets paged based on the output of our LLM call...” is particularly smart.

# 9:13 pm / ai, prompt-engineering, prompt-injection, generative-ai, llms

2023 » May

MTWTFSS
1234567
891011121314
15161718192021
22232425262728
293031