mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
docs
This commit is contained in:
parent
97d9bf17c0
commit
abd71bfb55
2 changed files with 16 additions and 0 deletions
15
docs/my-website/docs/tutorials/mock_completion.md
Normal file
15
docs/my-website/docs/tutorials/mock_completion.md
Normal file
|
@ -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")
|
||||||
|
```
|
|
@ -88,6 +88,7 @@ const sidebars = {
|
||||||
'tutorials/ab_test_llms',
|
'tutorials/ab_test_llms',
|
||||||
'tutorials/huggingface_tutorial',
|
'tutorials/huggingface_tutorial',
|
||||||
'tutorials/TogetherAI_liteLLM',
|
'tutorials/TogetherAI_liteLLM',
|
||||||
|
'tutorials/mock_completion',
|
||||||
'tutorials/finetuned_chat_gpt',
|
'tutorials/finetuned_chat_gpt',
|
||||||
'tutorials/sagemaker_llms',
|
'tutorials/sagemaker_llms',
|
||||||
'tutorials/text_completion',
|
'tutorials/text_completion',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue