BerriAI / litellm

Python SDK, Proxy Server (LLM Gateway) to call 100+ LLM APIs in OpenAI format - [Bedrock, Azure, OpenAI, VertexAI, Cohere, Anthropic, Sagemaker, HuggingFace, Replicate, Groq]
https://docs.litellm.ai/docs/
Other
14.17k stars 1.68k forks source link

(feat) Vertex AI - add support for fine tuned embedding models #6749

Closed ishaan-jaff closed 1 week ago

ishaan-jaff commented 1 week ago

Add support for fine tuned embedding models

litellm.embedding(model="vertex_ai/<your-model-id>", input)

Proxy Usage

  1. Add model to config.yaml
    
    model_list:
    - model_name: snowflake-arctic-embed-m-long-1731622468876
    litellm_params:
      model: vertex_ai/<your-model-id>
      vertex_project: "adroit-crow-413218"
      vertex_location: "us-central1"
      vertex_credentials: adroit-crow-413218-a956eef1a2a8.json 

litellm_settings: drop_params: True


2. Start Proxy 

$ litellm --config /path/to/config.yaml


3. Make Request using OpenAI Python SDK, Langchain Python SDK

```python
import openai

client = openai.OpenAI(api_key="sk-1234", base_url="http://0.0.0.0:4000")

response = client.embeddings.create(
    model="snowflake-arctic-embed-m-long-1731622468876", 
    input = ["good morning from litellm", "this is another item"],
)

print(response)
Screenshot 2024-11-14 at 4 09 04 PM

Relevant issues

Type

πŸ†• New Feature πŸ› Bug Fix 🧹 Refactoring πŸ“– Documentation πŸš„ Infrastructure βœ… Test

Changes

[REQUIRED] Testing - Attach a screenshot of any new tests passing locall

If UI changes, send a screenshot/GIF of working UI fixes

vercel[bot] commented 1 week ago

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
litellm βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Nov 15, 2024 1:53am