mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
update model split tests with ui
This commit is contained in:
parent
66bfd70253
commit
b44299cce7
8 changed files with 80 additions and 3 deletions
24
litellm/tests/test_split_test.py
Normal file
24
litellm/tests/test_split_test.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
#### What this tests ####
|
||||
# This tests the 'completion_with_split_tests' function to enable a/b testing between llm models
|
||||
|
||||
import sys, os
|
||||
import traceback
|
||||
|
||||
sys.path.insert(
|
||||
0, os.path.abspath("../..")
|
||||
) # Adds the parent directory to the system path
|
||||
import litellm
|
||||
from litellm import completion_with_split_tests
|
||||
litellm.set_verbose = True
|
||||
split_per_model = {
|
||||
"gpt-4": 0.7,
|
||||
"claude-instant-1.2": 0.3
|
||||
}
|
||||
|
||||
messages = [{ "content": "Hello, how are you?","role": "user"}]
|
||||
|
||||
# print(completion_with_split_tests(models=split_per_model, messages=messages))
|
||||
|
||||
# test with client
|
||||
|
||||
print(completion_with_split_tests(models=split_per_model, messages=messages, use_client=True, id=1234))
|
Loading…
Add table
Add a link
Reference in a new issue