2023-02-08 15:46:34 +00:00
|
|
|
# Using Large Language Models with Grist
|
|
|
|
|
|
|
|
In this experimental Grist feature, originally developed by Alex Hall,
|
2023-06-27 11:39:15 +00:00
|
|
|
you can hook up OpenAI's ChatGPT to write formulas for
|
2023-02-08 15:46:34 +00:00
|
|
|
you. Here's how.
|
|
|
|
|
2023-06-27 11:39:15 +00:00
|
|
|
First, you need an API key. Visit https://openai.com/api/ and prepare a key, then
|
2023-02-08 15:46:34 +00:00
|
|
|
store it in an environment variable `OPENAI_API_KEY`.
|
|
|
|
|
|
|
|
That's all the configuration needed!
|
|
|
|
|
|
|
|
Currently it is only a backend feature, we are still working on the UI for it.
|
|
|
|
|
2023-06-27 11:39:15 +00:00
|
|
|
## Hugging Face and other OpenAI models (deactivated)
|
|
|
|
|
|
|
|
_Not currently available, needs some work to revive. These notes are only preserved as a reminder to ourselves of how this worked._
|
2023-02-08 15:46:34 +00:00
|
|
|
|
2023-06-27 11:39:15 +00:00
|
|
|
~~To use a different OpenAI model such as `code-davinci-002` or `text-davinci-003`,
|
|
|
|
set the environment variable `COMPLETION_MODEL` to the name of the model.~~
|
|
|
|
|
|
|
|
~~Alternatively, there are many non-proprietary models hosted on Hugging Face.
|
|
|
|
At the time of writing, none can compare with OpenAI for use with Grist.
|
|
|
|
Things can change quickly in the world of AI though. So instead of OpenAI,
|
|
|
|
you can visit https://huggingface.co/ and prepare a key, then
|
|
|
|
store it in an environment variable `HUGGINGFACE_API_KEY`.~~
|
2023-02-08 15:46:34 +00:00
|
|
|
|
2023-06-27 11:39:15 +00:00
|
|
|
~~The model used will default to `NovelAI/genji-python-6B` for
|
2023-02-08 15:46:34 +00:00
|
|
|
Hugging Face. There's no particularly great model for this application,
|
|
|
|
but you can try other models by setting an environment variable
|
|
|
|
`COMPLETION_MODEL` to `codeparrot/codeparrot` or
|
2023-06-27 11:39:15 +00:00
|
|
|
`NinedayWang/PolyCoder-2.7B` or similar.~~
|
2023-02-08 15:46:34 +00:00
|
|
|
|
2023-06-27 11:39:15 +00:00
|
|
|
~~If you are hosting a model yourself, host it as Hugging Face does,
|
2023-02-08 15:46:34 +00:00
|
|
|
and use `COMPLETION_URL` rather than `COMPLETION_MODEL` to
|
2023-06-27 11:39:15 +00:00
|
|
|
point to the model on your own server rather than Hugging Face.~~
|