Announcing FastHTML. A new way to create modern interactive web apps.
Scales down to a 6-line python file; scales up to complex production apps.
Auth, DBs, caching, styling, etc built-in & replaceable and extensible. 1-click deploy to @Railway, @vercel, @huggingface, & more.
To get started, head over to the home page: .
The whole site, designed by the @tinloof gang, is itself a running FastHTML app, and includes live code examples running inside that page.fastht.ml
I started FastHTML because during 25+ years of web development, I realized that web programming could be easier & more powerful. I feel that recent trends move away from the power of the web’s foundations, resulting in a fractured ecosystem of over-complex frameworks and tools.
We've had preview users testing out FastHTML for the last few weeks, and the feedback has been amazing. One told us they rewrote their custom blog from react to FastHTML & their lines of code went down 5x.
If you want to dive right in, the docs have many end-to-end FastHTML example apps to learn from: docs.fastht.ml
I've created a 1-hour mini-course on FastHTML to show how to create and deploy a complete interactive web app from scratch using pure Python.
We've also got AI chat apps, collaborative games, canvas drawing apps, Stripe integration, and many more you can learn from in our examples repo: github.com/AnswerDotAI/fa…
If you're like me and learn best from reading code, we've created a complete FastHTML Todo example with custom authentication, drag & drop, DB integration, and more, with every line heavily commented to show you exactly what's going on: github.com/AnswerDotAI/fa…
FastHTML itself is very small -- under 1000 lines of code. The magic is in the ideas it brings together, particularly @htmx_org & ASGI/Uvicorn/Starlette. (Screenshots below from .) And we borrowed heavily from the design of @tiangolo's brilliant FastAPI. about.fastht.ml
Legendary Python coder and "Two Scoops of Django" co-author @audreyfeldroy told me that she thinks the real power of FastHTML is in how it scales up to make anything possible -- so it's worth putting in the time to learn it properly.
As @audreyfeldroy points out, FastHTML is very different to most web dev approaches, and stuff like our "FastTags" (FT) can feel pretty weird at first -- but once it clicks, you suddenly have superpowers!
If you want to try out a new, easier, faster, saner way to write web applications in Python, come on over to FastHTML! fastht.ml
Wanna try a little FastHTML app right now? I've created Web2MD, where you can paste in or load in any website, and it's converted to markdown. Click 'Go to markdown' to see the markdown, and click the 'copy' button to grab it.
PS: Web2MD is implemented in ~70 lines of code. And it even includes an API version. I use it for my LLMs all the time now -- I find it works more reliably than any of the other LLM markdown APIs I've tried. github.com/AnswerDotAI/we…
• • •
Missing some Tweet in this thread? You can try to
force a refresh
For those that hope (or worry) that LLMs will do breakthrough scientific research, I've got good (or bad) news:
LLMs are particularly, exceedingly, marvellously ill-suited to this task. (if you're a researcher, you'll have noticed this already)
Here's why🧵
Breakthrough research requires either:
1. Going in a totally new and unexpected direction that everyone decided long ago was stupid, or 2. Finding some extraordinary new experimental data that means we have to change our theories
LLMs can't run experiments, so we'll focus on 1
It's not helpful to just say "LLMs can't reason", since clearly they do some things which humans would use reasoning for.
But LLMs are, first and foremost, fuzzy subgraph matching machines (at *massive* scale*).
I've done a deep dive into SB 1047 over the last few weeks, and here's what you need to know:
*Nobody* should be supporting this bill in its current state. It will *not* actually cover the largest models, nor will it actually protect open source.
But it can be easily fixed!🧵
This is important, so don't just read this thread, instead read the 6000+ word article I just published.
In the article I explain how AI *actually* works, and why these details totally break legislation like SB 1047. Policy makers *need* to know this: answer.ai/posts/2024-06-…
SB 1047 does not cover "base models". But these are the models where >99% of compute is used. By not covering these models, the bill will probably actually not cover any models at all.
(There are also dozens of trivial workarounds for anyone wanting to train uncovered models.)
And here's the docs for sqlite-utils, which is a beautifully designed library that is clear, easy to understand, and introduces minimal new concepts to learn -- it's just SQL! sqlite-utils.datasette.io/en/stable/pyth…