forked from phoenix/litellm-mirror
(docs) update embedding docs
This commit is contained in:
parent
8251e71a2a
commit
7641729657
1 changed files with 23 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
||||||
# Embedding Models
|
# Embedding Models
|
||||||
|
|
||||||
## Usage
|
## Quick Start
|
||||||
```python
|
```python
|
||||||
from litellm import embedding
|
from litellm import embedding
|
||||||
import os
|
import os
|
||||||
|
@ -10,12 +10,29 @@ response = embedding('text-embedding-ada-002', input=["good morning from litellm
|
||||||
|
|
||||||
## OpenAI Embedding Models
|
## OpenAI Embedding Models
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
```python
|
||||||
|
from litellm import embedding
|
||||||
|
import os
|
||||||
|
os.environ['OPENAI_API_KEY'] = ""
|
||||||
|
response = embedding('text-embedding-ada-002', input=["good morning from litellm"])
|
||||||
|
```
|
||||||
|
|
||||||
| Model Name | Function Call | Required OS Variables |
|
| Model Name | Function Call | Required OS Variables |
|
||||||
|----------------------|---------------------------------------------|--------------------------------------|
|
|----------------------|---------------------------------------------|--------------------------------------|
|
||||||
| text-embedding-ada-002 | `embedding('text-embedding-ada-002', input)` | `os.environ['OPENAI_API_KEY']` |
|
| text-embedding-ada-002 | `embedding('text-embedding-ada-002', input)` | `os.environ['OPENAI_API_KEY']` |
|
||||||
|
|
||||||
## Azure OpenAI Embedding Models
|
## Azure OpenAI Embedding Models
|
||||||
|
|
||||||
|
### API keys
|
||||||
|
This can be set as env variables or passed as **params to litellm.embedding()**
|
||||||
|
```python
|
||||||
|
import os
|
||||||
|
os.environ['AZURE_API_KEY'] =
|
||||||
|
os.environ['AZURE_API_BASE'] =
|
||||||
|
os.environ['AZURE_API_VERSION'] =
|
||||||
|
```
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
```python
|
```python
|
||||||
from litellm import embedding
|
from litellm import embedding
|
||||||
|
@ -29,15 +46,16 @@ response = embedding(
|
||||||
print(response)
|
print(response)
|
||||||
```
|
```
|
||||||
|
|
||||||
| Model Name | Function Call | Required OS Variables |
|
| Model Name | Function Call |
|
||||||
|----------------------|---------------------------------------------|--------------------------------------|
|
|----------------------|---------------------------------------------|
|
||||||
| text-embedding-ada-002 | `embedding('embedding-model-deployment', input=input, custom_llm_provider="azure")` | `os.environ['AZURE_API_KEY']`,`os.environ['AZURE_API_BASE']`,`os.environ['AZURE_API_VERSION']` |
|
| text-embedding-ada-002 | `embedding(model="azure/<your deployment name>", input=input)` |
|
||||||
|
|
||||||
h/t to [Mikko](https://www.linkedin.com/in/mikkolehtimaki/) for this integration
|
h/t to [Mikko](https://www.linkedin.com/in/mikkolehtimaki/) for this integration
|
||||||
|
|
||||||
## Cohere Embedding Models
|
## Cohere Embedding Models
|
||||||
https://docs.cohere.com/reference/embed
|
https://docs.cohere.com/reference/embed
|
||||||
|
|
||||||
|
### Usage
|
||||||
```python
|
```python
|
||||||
from litellm import embedding
|
from litellm import embedding
|
||||||
import os
|
import os
|
||||||
|
@ -54,6 +72,7 @@ response = embedding('embed-english-v2.0', input=["good morning from litellm"])
|
||||||
## HuggingFace Embedding Models
|
## HuggingFace Embedding Models
|
||||||
LiteLLM supports all Feature-Extraction Embedding models: https://huggingface.co/models?pipeline_tag=feature-extraction
|
LiteLLM supports all Feature-Extraction Embedding models: https://huggingface.co/models?pipeline_tag=feature-extraction
|
||||||
|
|
||||||
|
### Usage
|
||||||
```python
|
```python
|
||||||
from litellm import embedding
|
from litellm import embedding
|
||||||
import os
|
import os
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue