← Lesson
What Is an LLM?
Joeven
Run
Reset
Python loads on first run
def complete(prefix, table): return table.get(prefix, "...") table = { "The capital of France is": " Paris.", "SELECT * FROM": " users;", "2 + 2 =": " 4", "The CEO of Acme as of today is": " [plausible name]", } for p in [ "The capital of France is", "2 + 2 =", "The CEO of Acme as of today is", ]: print(repr(p), "->", repr(complete(p, table))) print("the last line is fluent and maybe wrong — that is the product")
Run to execute this in your browser. Nothing is sent to a server.