From abd71bfb55a30e11db3417e49b92ae504ba5d64e Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Fri, 15 Sep 2023 12:26:44 -0700 Subject: [PATCH] docs --- docs/my-website/docs/tutorials/mock_completion.md | 15 +++++++++++++++ docs/my-website/sidebars.js | 1 + 2 files changed, 16 insertions(+) create mode 100644 docs/my-website/docs/tutorials/mock_completion.md diff --git a/docs/my-website/docs/tutorials/mock_completion.md b/docs/my-website/docs/tutorials/mock_completion.md new file mode 100644 index 0000000000..12fac3d59d --- /dev/null +++ b/docs/my-website/docs/tutorials/mock_completion.md @@ -0,0 +1,15 @@ +# Mock Completion Responses - Save Testing Costs + +Trying to test making LLM Completion calls without calling the LLM APIs ? +Pass `mock_response` to `litellm.completion` and litellm will directly return the response without neededing the call the LLM API and spend $$ + +## Using `mock_response` + +```python +from litellm import completion + +model = "gpt-3.5-turbo" +messages = [{"role":"user", "content":"Why is LiteLLM amazing?"}] + +completion(model=model, messages=messages, mock_response="It's simple to use and easy to get started") +``` \ No newline at end of file diff --git a/docs/my-website/sidebars.js b/docs/my-website/sidebars.js index 46ce12c87b..384c4886cb 100644 --- a/docs/my-website/sidebars.js +++ b/docs/my-website/sidebars.js @@ -88,6 +88,7 @@ const sidebars = { 'tutorials/ab_test_llms', 'tutorials/huggingface_tutorial', 'tutorials/TogetherAI_liteLLM', + 'tutorials/mock_completion', 'tutorials/finetuned_chat_gpt', 'tutorials/sagemaker_llms', 'tutorials/text_completion',