docs(docs.md): cleanup litellm api docs

This commit is contained in:
Krrish Dholakia 2023-10-07 10:58:14 -07:00
parent 299d46ac45
commit b90f352736
3 changed files with 1 additions and 70 deletions

View file

@ -309,75 +309,6 @@ print("Cost for completion call with gpt-3.5-turbo: ", f"${float(cost):.10f}")
Cost for completion call with gpt-3.5-turbo: $0.0000775000
```
## LiteLLM API
The LiteLLM API allows you to access LLMs you might not have access to (example Claude-2)
<Tabs>
<TabItem value="claude-2" label="Claude-2">
```python
import os
from litellm import completion
# use the LiteLLM API Key
os.environ["ANTHROPIC_API_KEY"] = "your-api-key"
messages = [{ "content": "Hello, how are you?","role": "user"}]
response = completion(model="togethercomputer/falcon-40b-instruct", messages=messages)
print(response)
```
</TabItem>
<TabItem value="gpt-4" label="GPT-4">
```python
import os
from litellm import completion
# use the LiteLLM API Key
os.environ["OPENAI_API_KEY"] = "your-api-key"
messages = [{ "content": "Hello, how are you?","role": "user"}]
response = completion(model="gpt-4", messages=messages)
print(response)
```
</TabItem>
<TabItem value="llama2" label="Llama2-70B">
```python
import os
from litellm import completion
# use the LiteLLM API Key
os.environ["TOGETHERAI_API_KEY"] = "your-api-key"
messages = [{ "content": "Hello, how are you?","role": "user"}]
response = completion(model="togethercomputer/llama-2-70b-chat", messages=messages)
print(response)
```
</TabItem>
<TabItem value="falcon-40b-instruct" label="Falcon-40B">
```python
import os
from litellm import completion
# use the LiteLLM API Key
os.environ["TOGETHERAI_API_KEY"] = "your-api-key"
messages = [{ "content": "Hello, how are you?","role": "user"}]
response = completion(model="togethercomputer/falcon-40b-instruct", messages=messages)
print(response)
```
</TabItem>
</Tabs>
👉 See all supported providers on [LiteLLM API](./proxy.md)
Need a dedicated key? Email us @ krrish@berri.ai

View file

@ -1,6 +1,6 @@
[tool.poetry]
name = "litellm"
version = "0.5.004"
version = "0.5.0"
description = "Library to easily interface with LLM API providers"
authors = ["BerriAI"]
license = "MIT License"