Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: rename id to model #527

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/amazon-bedrock/promptfooconfig.claude.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ prompts:
- 'Convert this English to {{language}}: {{input}}'
- 'Translate to {{language}}: {{input}}'
providers:
- id: bedrock:completion:anthropic.claude-instant-v1
- model: bedrock:completion:anthropic.claude-instant-v1
config:
region: 'us-west-2'
temperature: 0.7
Expand Down
2 changes: 1 addition & 1 deletion examples/amazon-bedrock/promptfooconfig.titan-text.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ prompts:
- 'Convert this English to {{language}}: {{input}}'
- 'Translate to {{language}}: {{input}}'
providers:
- id: bedrock:completion:amazon.titan-text-lite-v1
- model: bedrock:completion:amazon.titan-text-lite-v1
config:
region: 'us-west-2'
textGenerationConfig:
Expand Down
4 changes: 2 additions & 2 deletions examples/azure-openai/promptfooconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ prompts:
- 'Generate one very interesting fact about {{topic}}'

providers:
- id: azureopenai:chat:gpt-35-turbo-deployment1
- model: azureopenai:chat:gpt-35-turbo-deployment1
config:
apiHost: 'your-org.openai.azure.com'

Expand All @@ -20,6 +20,6 @@ tests:
- type: similar
value: Bananas are naturally radioactive.
provider:
id: azureopenai:embeddings:ada-deployment1
model: azureopenai:embeddings:ada-deployment1
config:
apiHost: 'your-org.openai.azure.com'
4 changes: 2 additions & 2 deletions examples/cohere/simple_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ prompts:
- "Write a tweet about {{topic}}"

providers:
- id: cohere:command
- model: cohere:command
config:
temperature: 0.5
prompt_truncation: AUTO
connectors:
- id: web-search
- model: web-search
showSearchQueries: true

tests:
Expand Down
16 changes: 8 additions & 8 deletions examples/custom-provider/promptfooconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ tests: vars.csv
# To compare two of the same provider, you can do the following:
#
# providers:
# - customProvider.js:
# id: custom-provider-hightemp
# config:
# temperature: 1.0
# - customProvider.js:
# id: custom-provider-lowtemp
# config:
# temperature: 0
# - model: customProvider.js
# label: custom-provider-hightemp
# config:
# temperature: 1.0
# - model: customProvider.js
# label: custom-provider-lowtemp
# config:
# temperature: 0
2 changes: 1 addition & 1 deletion examples/external-provider-config/gpt-3.5.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
id: 'openai:chat:gpt-3.5-turbo-0613'
model: 'openai:chat:gpt-3.5-turbo-0613'
config:
functions:
[
Expand Down
4 changes: 2 additions & 2 deletions examples/gemma-vs-llama/promptfooconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ prompts:
- "{{message}}"

providers:
- id: replicate:meta/llama-2-7b-chat
- model: replicate:meta/llama-2-7b-chat
config:
temperature: 0.01 # minimum temperature
max_new_tokens: 1024
prompt:
prefix: "[INST] "
suffix: "[/INST] "

- id: replicate:cjwbw/gemma-7b-it:2790a695e5dcae15506138cc4718d1106d0d475e6dca4b1d43f42414647993d5
- model: replicate:cjwbw/gemma-7b-it:2790a695e5dcae15506138cc4718d1106d0d475e6dca4b1d43f42414647993d5
config:
temperature: 0.01
max_new_tokens: 1024
Expand Down
6 changes: 3 additions & 3 deletions examples/gemma-vs-mistral/promptfooconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ defaultTest:
transform: output.trim()

providers:
- id: replicate:mistralai/mistral-7b-instruct-v0.2
- model: replicate:mistralai/mistral-7b-instruct-v0.2
config:
temperature: 0.01
max_new_tokens: 1024
prompt:
prefix: "<s>[INST] "
suffix: " [/INST]"

- id: replicate:mistralai/mixtral-8x7b-instruct-v0.1
- model: replicate:mistralai/mixtral-8x7b-instruct-v0.1
config:
temperature: 0.01
max_new_tokens: 1024
prompt:
prefix: "<s>[INST] "
suffix: " [/INST]"

- id: replicate:cjwbw/gemma-7b-it:2790a695e5dcae15506138cc4718d1106d0d475e6dca4b1d43f42414647993d5
- model: replicate:cjwbw/gemma-7b-it:2790a695e5dcae15506138cc4718d1106d0d475e6dca4b1d43f42414647993d5
config:
temperature: 0.01
max_new_tokens: 1024
Expand Down
2 changes: 1 addition & 1 deletion examples/google-aistudio-gemini/promptfooconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ prompts:
- "Write a very concise, funny tweet about {{topic}}"

providers:
- id: google:gemini-pro
- model: google:gemini-pro
config:
generationConfig:
temperature: 0
Expand Down
16 changes: 8 additions & 8 deletions examples/gpt-3.5-temperature-comparison/promptfooconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ prompts:
- 'Respond to the following instruction: {{message}}'

providers:
- openai:gpt-3.5-turbo-0613:
id: openai-gpt-3.5-turbo-lowtemp
config:
temperature: 0
- openai:gpt-3.5-turbo-0613:
id: openai-gpt-3.5-turbo-hightemp
config:
temperature: 1
- model: openai:gpt-3.5-turbo-0613
label: openai-gpt-3.5-turbo-lowtemp
config:
temperature: 0
- model: openai:gpt-3.5-turbo-0613
label: openai-gpt-3.5-turbo-hightemp
config:
temperature: 1

tests:
- vars:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ prompts:
- "Write a tweet about {{topic}}:"

providers:
- id: huggingface:text-generation:gemma-7b-it
- model: huggingface:text-generation:gemma-7b-it
config:
apiEndpoint: https://v9igsezez4ei3cq4.us-east-1.aws.endpoints.huggingface.cloud
# apiKey: abc123 # Or set HF_API_TOKEN environment variable
Expand Down
38 changes: 21 additions & 17 deletions examples/llama-gpt-comparison/promptfooconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,27 @@ prompts:
prompts/completion_prompt.txt: completion_prompt

providers:
- openai:gpt-3.5-turbo-0613:
id: openai-gpt-3.5-turbo-lowtemp
prompts: chat_prompt
config:
temperature: 0
max_tokens: 128
- openai:gpt-3.5-turbo-0613:
id: openai-gpt-3.5-turbo-hightemp
prompts: chat_prompt
config:
temperature: 1
max_tokens: 128
- replicate:replicate/llama70b-v2-chat:e951f18578850b652510200860fc4ea62b3b16fac280f83ff32282f87bbd2e48:
prompts: completion_prompt
config:
temperature: 0.01 # minimum temperature
max_length: 128
- model: openai:gpt-3.5-turbo-0613
label: openai-gpt-3.5-turbo-lowtemp
prompts:
- chat_prompt
config:
temperature: 0
max_tokens: 128
- model: openai:gpt-3.5-turbo-0613
label: openai-gpt-3.5-turbo-hightemp
prompts:
- chat_prompt
config:
temperature: 1
max_tokens: 128
- model: replicate:meta/llama70b-v2-chat:02e509c789964a7ea8736978a43525956ef40397be9033abf9fd2badfe68c9e3
label: llama70b-v2-chat
prompts:
- completion_prompt
config:
temperature: 0.01 # minimum temperature
max_length: 128

tests:
- vars:
Expand Down
4 changes: 4 additions & 0 deletions examples/llama-gpt-comparison/prompts/chat_prompt.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
[
{
"role": "system",
"content": "You are a pirate"
},
{
"role": "user",
"content": "{{message}}"
Expand Down
6 changes: 4 additions & 2 deletions examples/llama-gpt-comparison/prompts/completion_prompt.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
User: {{message}}
Assistant:
[INST] <<SYS>>
You are a pirate
<</SYS>>
{{message}}
35 changes: 19 additions & 16 deletions examples/mistral-llama-comparison/promptfooconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,25 @@ prompts:
prompts/llama_prompt.txt: llama_prompt

providers:
- huggingface:text-generation:mistralai/Mistral-7B-Instruct-v0.1:
prompts: mistral_prompt
config:
temperature: 0.01
max_new_tokens: 128
- replicate:mistralai/mixtral-8x7b-instruct-v0.1:2b56576fcfbe32fa0526897d8385dd3fb3d36ba6fd0dbe033c72886b81ade93e:
prompts: mistral_prompt
config:
temperature: 0.01
max_new_tokens: 128
prompt_template: '{prompt}'
- replicate:meta/llama-2-7b-chat:8e6975e5ed6174911a6ff3d60540dfd4844201974602551e10e9e87ab143d81e:
prompts: llama_prompt
config:
temperature: 0.01
max_new_tokens: 128
- model: huggingface:text-generation:mistralai/Mistral-7B-Instruct-v0.1
prompts:
- mistral_prompt
config:
temperature: 0.01
max_new_tokens: 128
- model: replicate:mistralai/mixtral-8x7b-instruct-v0.1
prompts:
- mistral_prompt
config:
temperature: 0.01
max_new_tokens: 128
prompt_template: '{prompt}'
- model: replicate:meta/llama-2-7b-chat:2d19859030ff705a87c746f7e96eea03aefb71f166725aee39692f1476566d48
prompts:
- llama_prompt
config:
temperature: 0.01
max_new_tokens: 128

tests:
- vars:
Expand Down
22 changes: 12 additions & 10 deletions examples/ollama-comparison/promptfooconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ prompts:
prompts/llama_prompt.txt: llama_prompt

providers:
- ollama:llama2:
prompts: llama_prompt
config:
num_predict: 1024
- ollama:llama2-uncensored:
prompts: llama_prompt
config:
num_predict: 1024
- openai:gpt-3.5-turbo:
prompts: openai_prompt
- id: ollama:llama2
prompts:
- llama_prompt
config:
num_predict: 1024
- id: ollama:llama2-uncensored
prompts:
- llama_prompt
config:
num_predict: 1024
- id: openai:gpt-3.5-turbo
prompts: openai_prompt

defaultTest:
assert:
Expand Down
4 changes: 2 additions & 2 deletions examples/perplexity.ai-example/promptfooconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ prompts:

providers:
# Compare GPT 3.5 vs Perplexity 70B
- id: openai:chat:gpt-3.5-turbo-0613
- id: openai:chat:pplx-70b-online
- model: openai:chat:gpt-3.5-turbo-0613
- model: openai:chat:pplx-70b-online
config:
apiBaseUrl: https://api.perplexity.ai
apiKeyEnvar: PERPLEXITY_API_KEY
Expand Down
2 changes: 1 addition & 1 deletion examples/python-provider/promptfooconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ prompts:
- "Write a very concise, funny tweet about {{topic}}"

providers:
- id: python:provider.py # or provider_async.py
- model: python:provider.py # or provider_async.py
config:
someOption: foobar

Expand Down
4 changes: 2 additions & 2 deletions examples/replicate-lifeboat/promptfooconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ prompts:
- 'Respond to the user concisely: {{message}}'

providers:
- id: openai:chat:gpt-3.5-turbo
- model: openai:chat:gpt-3.5-turbo
config:
apiKey: '...'
temperature: 0.01
max_tokens: 512
- id: openai:chat:meta/llama-2-70b-chat
- model: openai:chat:meta/llama-2-70b-chat
config:
apiKey: '...'
apiBaseUrl: https://openai-proxy.replicate.com
Expand Down
4 changes: 2 additions & 2 deletions site/docs/configuration/expected-outputs/model-graded.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ tests:

## Examples (comparison)

The `select-best` assertion type is used to compare multiple outputs in the same TestCase row and select the one that best meets a specified criterion.
The `select-best` assertion type is used to compare multiple outputs in the same TestCase row and select the one that best meets a specified criterion.

Here's an example of how to use `select-best` in a configuration file:

Expand Down Expand Up @@ -178,7 +178,7 @@ Use the `provider.config` field to set custom parameters:

```yaml
provider:
- id: openai:gpt-3.5-turbo
- model: openai:gpt-3.5-turbo
config:
temperature: 0
```
Expand Down
12 changes: 6 additions & 6 deletions site/docs/configuration/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,12 @@ prompts:
prompts/llama_completion_prompt.txt: llama_completion_prompt

providers:
- openai:gpt-3.5-turbo-0613:
prompts: gpt_chat_prompt
- openai:gpt-4-turbo-0613:
prompts: gpt_chat_prompt
- replicate:replicate/llama70b-v2-chat:e951f18578850b652510200860fc4ea62b3b16fac280f83ff32282f87bbd2e48:
prompts: llama_completion_prompt
- model: openai:gpt-3.5-turbo-0613
prompts: gpt_chat_prompt
- model: openai:gpt-4-turbo-0613
prompts: gpt_chat_prompt
- model: replicate:replicate/llama70b-v2-chat:e951f18578850b652510200860fc4ea62b3b16fac280f83ff32282f87bbd2e48
prompts: llama_completion_prompt
```

In this configuration, the `gpt_chat_prompt` is used for both GPT-3.5 and GPT-4 models, while the `llama_completion_prompt` is used for the Llama v2 model. The prompts are defined in separate files within the `prompts` directory.
Expand Down
8 changes: 4 additions & 4 deletions site/docs/guides/azure-vs-openai.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ Edit your `promptfooconfig.yaml` to include both OpenAI and Azure OpenAI as prov

```yaml
providers:
- id: openai:chat:gpt-3.5-turbo
- id: azureopenai:chat:my-gpt-35-turbo-deployment
- model: openai:chat:gpt-3.5-turbo
- model: azureopenai:chat:my-gpt-35-turbo-deployment
config:
apiHost: myazurehost.openai.azure.com
```
Expand All @@ -59,11 +59,11 @@ For each provider, you may configure additional parameters such as `temperature`

```yaml
providers:
- id: openai:chat:gpt-3.5-turbo
- model: openai:chat:gpt-3.5-turbo
config:
temperature: 0
max_tokens: 128
- id: azureopenai:chat:my-gpt-35-turbo-deployment
- model: azureopenai:chat:my-gpt-35-turbo-deployment
config:
apiHost: your_azure_openai_host
temperature: 0
Expand Down