Skip to content

Commit

Permalink
test(test_batch_completion.py): cleanup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
krrishdholakia committed Oct 24, 2023
1 parent 3ec103f commit cb100d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 27 deletions.
2 changes: 2 additions & 0 deletions litellm/tests/litellm_results.jsonl
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@
[{"model": "gpt-3.5-turbo-16k", "messages": [{"content": "Please provide a summary of the latest scientific discoveries.", "role": "user"}], "api_key": "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"}, {"id": "chatcmpl-8DG4449c5ZTIrzJ6s0eslGRib3Jw3", "object": "chat.completion", "created": 1698170708, "model": "gpt-3.5-turbo-16k-0613", "choices": [{"index": 0, "message": {"role": "assistant", "content": "As an AI language model, I don't have access to real-time information or the ability to browse the internet. Consequently, I cannot provide a summary of the very latest scientific discoveries. However, I can provide a general overview of some significant recent discoveries from various scientific fields that have been covered in the news. Keep in mind that these summaries are not exhaustive and may not include the most recent breakthroughs:\n\n1. Astrophysics: In April 2019, the Event Horizon Telescope captured the first-ever image of a black hole in the center of the galaxy Messier 87. This provided dramatic evidence supporting Einstein's theory of general relativity.\n\n2. Medicine: In November 2020, the Pfizer/BioNTech and Moderna COVID-19 vaccines were announced, marking significant progress in the fight against the global pandemic. Both vaccines utilize mRNA technology to stimulate an immune response to the virus.\n\n3. Quantum Computing: In October 2019, Google claimed to have achieved \"quantum supremacy\" by solving a calculation that would have taken the world's most powerful supercomputer thousands of years in just 200 seconds.\n\n4. Genetics: CRISPR-Cas9, a revolutionary gene-editing technology, has made significant strides in recent years. Researchers have successfully edited genes in human embryos to correct genetic mutations, opening up possibilities for treating otherwise incurable genetic diseases.\n\n5. Climate Change: Scientists have been studying the impacts of climate change and their consequences. Recent findings include increased melting of polar ice caps, rising sea levels, and the higher frequency and intensity of extreme weather events like hurricanes and heatwaves.\n\nPlease note that these summaries might not represent the most recent scientific discoveries in each field. Scientific advancements occur at a rapid pace, and it is best to refer to reputable scientific journals, news outlets, or academic sources for the most up-to-date information."}, "finish_reason": "stop"}], "usage": {"prompt_tokens": 17, "completion_tokens": 373, "total_tokens": 390}}]
[{"model": "gpt-3.5-turbo-16k", "messages": [{"content": "Please provide a summary of the latest scientific discoveries.", "role": "user"}], "api_key": "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"}, {"id": "chatcmpl-8DHsKHZnQN3G40eCJrlM94FJp5bqo", "object": "chat.completion", "created": 1698177668, "model": "gpt-3.5-turbo-16k-0613", "choices": [{"index": 0, "message": {"role": "assistant", "content": "As an AI language model, I don't have direct access to real-time information or the ability to browse the internet. Thus, I can't provide a summary of the latest scientific discoveries. My responses are generated based on a mixture of licensed data, data created by human trainers, and publicly available data. So, I can provide general information about scientific discoveries, but I won't be familiar with specific, recent breakthroughs or studies. It's always best to refer to trusted scientific sources and news outlets for the most up-to-date information regarding the latest discoveries."}, "finish_reason": "stop"}], "usage": {"prompt_tokens": 17, "completion_tokens": 112, "total_tokens": 129}}]
[{"model": "gpt-3.5-turbo-16k", "messages": [{"content": "Please provide a summary of the latest scientific discoveries.", "role": "user"}], "api_key": "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"}, {"id": "chatcmpl-8DHsKrhGvSMqWH6yUkfp3KoVpfkKM", "object": "chat.completion", "created": 1698177668, "model": "gpt-3.5-turbo-16k-0613", "choices": [{"index": 0, "message": {"role": "assistant", "content": "It is impossible for me to provide a summary of the latest scientific discoveries as they are constantly evolving and being published across various fields. However, some notable recent scientific findings include advancements in COVID-19 research and vaccinations, breakthroughs in quantum computing and artificial intelligence, progress in understanding climate change and its impacts, developments in medical treatments and gene editing technologies, and discoveries in space exploration and astronomy. These are just a few examples, and there are countless more scientific discoveries being made every day across different disciplines all over the world."}, "finish_reason": "stop"}], "usage": {"prompt_tokens": 17, "completion_tokens": 104, "total_tokens": 121}}]
[{"model": "gpt-3.5-turbo-16k", "messages": [{"content": "Please provide a summary of the latest scientific discoveries.", "role": "user"}], "api_key": "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"}, {"id": "chatcmpl-8DJsFe4zsqCatn1MIuxEDwhq3VOVv", "object": "chat.completion", "created": 1698185351, "model": "gpt-3.5-turbo-16k-0613", "choices": [{"index": 0, "message": {"role": "assistant", "content": "As an AI language model, I don't have access to real-time data or the ability to browse the internet. Therefore, I cannot provide you with the latest scientific discoveries specifically. However, I can provide you with a summary of some recent scientific advancements across various fields. Please specify which field or area of scientific discovery you are interested in, and I'll be happy to provide a summary based on the available knowledge up until September 2021."}, "finish_reason": "stop"}], "usage": {"prompt_tokens": 17, "completion_tokens": 89, "total_tokens": 106}}]
[{"model": "gpt-3.5-turbo-16k", "messages": [{"content": "Please provide a summary of the latest scientific discoveries.", "role": "user"}], "api_key": "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"}, {"id": "chatcmpl-8DJsFSxQ1FVmbF5LjoJw6GSXjEzec", "object": "chat.completion", "created": 1698185351, "model": "gpt-3.5-turbo-16k-0613", "choices": [{"index": 0, "message": {"role": "assistant", "content": "As an AI language model, I can provide a general summary of some notable scientific discoveries across various fields in recent times. However, please note that this summary may not reflect the very latest discoveries, as scientific research progress continuously and new findings are reported regularly. Here are a few noteworthy discoveries from disparate scientific disciplines:\n\n1. Astronomy: Gravitational waves were detected for the first time in 2015, confirming a prediction made by Albert Einstein in his theory of general relativity. This breakthrough opened up a new way to observe the Universe and study celestial objects that emit these waves.\n\n2. Genetics: The CRISPR-Cas9 gene-editing technique has revolutionized genetics and molecular biology. It allows scientists to edit DNA sequences with unprecedented precision, offering potential for treating genetic disorders, modifying crops, and advancing scientific research.\n\n3. Environmental Science: In recent years, research has provided substantial evidence for human-induced climate change, emphasizing the need to reduce greenhouse gas emissions. Studies continue to highlight the impacts of our actions on weather patterns, sea-level rise, and ecosystems worldwide.\n\n4. Particle Physics: In 2012, the discovery of the Higgs boson at the Large Hadron Collider (LHC) in CERN was a significant milestone. It confirmed the existence of the Higgs field and helped to validate the Standard Model, our current understanding of particle physics.\n\n5. Medicine: The development of mRNA-based COVID-19 vaccines, such as those from Pfizer-BioNTech and Moderna, has been a breakthrough in vaccine technology. This approach provides a new method for rapid vaccine development against emerging viruses.\n\n6. Neuroscience: Recent advancements in brain-computer interfaces (BCIs) have allowed researchers to develop devices that can translate neural activity into commands, enabling people with paralysis to control external devices like robotic arms through their thoughts.\n\nThese are just a few examples of scientific breakthroughs across different fields, and new discoveries are continually being made as research progresses in diverse scientific disciplines."}, "finish_reason": "stop"}], "usage": {"prompt_tokens": 17, "completion_tokens": 397, "total_tokens": 414}}]
27 changes: 0 additions & 27 deletions litellm/tests/test_batch_completions.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,30 +63,3 @@ def test_batch_completion_models_all_responses():
# pytest.fail(f"An error occurred: {e}")
# test_batch_completions()



def test_rate_limit_handler():
import asyncio
##### USAGE ################

jobs = [
{"model": "gpt-3.5-turbo-16k", "messages": [{"content": "Please provide a summary of the latest scientific discoveries.", "role": "user"}]},
{"model": "gpt-3.5-turbo-16k", "messages": [{"content": "Please provide a summary of the latest scientific discoveries.", "role": "user"}]},
]

from litellm import RateLimitManager

handler = RateLimitManager(
max_requests_per_minute = 60,
max_tokens_per_minute = 20000
)

try:
asyncio.run(
handler.batch_completion(
jobs = jobs,
api_key=os.environ['OPENAI_API_KEY'],
)
)
except Exception as e:
print(e)

0 comments on commit cb100d1

Please sign in to comment.