Simon Couch - Posit, PBC
Open Source Group, R / LLMs
These are the same:
Your turn! Create a chat object and say āhey!ā
chat_github()
might ājust workāchat_anthropic()
using instructions linked below03:00
Your turn: adjust the system prompt to the model so that, when supplied a question like āWhatās 2+2?ā, the model returns only the answer as a digit, no punctuation or exposition.
03:00
OpenAI and Anthropic have two main ways they make money from their models:
API usage is āpay-as-you-goā by token:
un|con|ventional
Hereās the pricing per million tokens for some common models:
Name | Input | Output |
---|---|---|
GPT 4o | $3.75 | $15.00 |
GPT 4o-mini | $0.15 | $0.60 |
Claude 4 Sonnet | $3.00 | $15.00 |
To put that into context, the source code for these slides so far is 650 tokens.
If I input them to GPT 4o:
\[ 650 \text{ tokens} \times \frac{\$3.75 }{1,000,000~\text{tokens}} = \$0.00244 \]
A picture is worth a thousand words
This is roughly correct! Depending on the model, pictures are ~600 tokens.
These are the same:
Your turn: provide a model with an image and ask it a question about it.
03:00
Your turn: Write a function that takes a path to an image file and returns a Yes/No answer the question āAre there non-forested areas here?ā
06:00
A āproviderā is a service that hosts models on an API.
In ellmer, each provider has its own chat_*()
function, like chat_github()
or chat_anthropic()
chat_github()
serves some popular models, like GPT-4o, for āfreeā
chat_openai()
chat_anthropic()
serves Claude Sonnet
You can be your own āproviderā, too:
chat_ollama()
uses a model that runs on your laptop
Many organizations have private deployments of models set up for internal, secure use. ellmer supports the common ones.
Make sure you test with models that the USFS can actually use!
ellmer has a companion package, vitals, for evaluation of products built with ellmer.
At the end of the summer, you should probably be able to answer the questions:
At the end of the summer, you should probably be able to answer the questions:
vitals can help you answer these sorts of questions.
github.com/simonpcouch/ufds-25