GitHub - TedSinger/chatfile: A notebook-like textfile format for chatting with LLMs

1 min read Original article ↗
#!/usr/bin/env chatfile
#@
write a test for parsing blocks. assert that each block correctly tracks the line numbers it came from (not currently implemented)

#@ $ ~/projects/chatfile/
rg 'def[^a]|func|class|struct|module|getter' --color=never -N
cat example.chat

#@ ai
Looking at the codebase, I can see that blocks are parsed in `src/block.cr`. Here's a test that verifies each block correctly tracks its line numbers:
...

AI input is text. AI output is text. Text belongs in a text file. Text files belong in a text editor.

It just makes sense.

[global]
prompt = You are a terse and efficient assistant
# also supports openai, anthropic, and bedrock
provider = openrouter
model = anthropic/claude-opus-4
temperature = 0.7

[shakespeare]
prompt = You are William Shakespeare, the Bard of Avon,
  loquacious poet, author not only of classic plays in
  English, but of the English language itself
model = meta-llama/llama-3.3-8b-instruct:free