4/17
Part 2 of 7 · VersionsLearn and do
Save every version, and never change one
A prompt is a name that changes over time. A version is one exact state of it: the template, the model, the parameters and the version it came from. Once saved, a version never changes, so a run, an eval or a production call can name exactly what it used.
Git works this way. The Pro Git book calls git a content-addressable filesystem: a key-value store where an object's key comes from a hash of its content. Give a version the same kind of id.
store = Versions()
base = "You help customers of an outdoor shop.\n\nQuestion: {{question}}"
first = {"template": base, "model": "claude-sonnet-5-5", "temperature": 0.2}
v1 = store.save(first)
again = store.save(dict(first))
v2 = store.save({**first, "template": base.replace("shop.", "shop. Answer in two sentences.")}, parent=v1)
print(v1 == again, v1 == v2, len(store.store))
Someone clicks save twice without changing anything, then makes one edit and saves again. How many versions are stored?
Pick one to see what it prints.
Pick an answer above to see the rest