3 ms·
This uses an OpenAI-compatible endpoint, so got this working with my https://llm.datasette.io/ https://llm.datasette.io/ CLI tool. First I added their models t
by simonw 1y ago
This uses an OpenAI-compatible endpoint, so got this working with my https://llm.datasette.io/ https://llm.datasette.io/ CLI tool.
First I added their models to my ~/Library/Application Support/io.datasette.llm/extra-openai-models.yaml file:
- model_id: morph-auto
model_name: auto
api_base: https://api.morphllm.com/v1
api_key_name: morph
Then I added the API key like this:
llm keys set morph
# Paste in API key from https://morphllm.com/api-keys
Then I saved an LLM template with their prompting pattern:
llm -m morph-auto '<code>$code</code><update>$update</update>' --save morph
Now I can run operations like this:
llm -t morph -p code "$(cat orig.txt)" -p update "$(cat update.txt)"
The -t option is the template I named when I ran --save. The -p name value options then set the content for the template $code and $update variables.
Example transcript here: https://gist.github.com/simonw/de67818603d448a3fee788ace29765fe#response https://gist.github.com/simonw/de67818603d448a3fee788ace2976...
One thing that worries me: since it's using XML-style tags <code> and <update>, if my own source code contains those tags I expect it may get confused.
- deleted 1y ago[deleted]
- bhaktatejas922 1y agoWow that was fast - this is awesome. it shouldnt be a problem unless your code has both <code> and <update> internally. 1 or the other should be fine
- nailer 1y ago[flagged]