mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-11 03:38:38 +00:00
docs(docs.md): cleanup litellm api docs
This commit is contained in:
parent
299d46ac45
commit
b90f352736
3 changed files with 1 additions and 70 deletions
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue