Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

docs(vertex.md): fix codestral fim placement (#5946)

Khanh Le71f68ac18542
diff --git a/docs/my-website/docs/providers/vertex.md b/docs/my-website/docs/providers/vertex.md
index be31506f79e..b0d1ed698a5 100644
--- a/docs/my-website/docs/providers/vertex.md
+++ b/docs/my-website/docs/providers/vertex.md
@@ -983,14 +983,11 @@ curl --location 'http://0.0.0.0:4000/chat/completions' \
</Tabs>
-## AI21 Models
-
-| Model Name | Function Call |
-|------------------|--------------------------------------|
-| jamba-1.5-mini@001 | `completion(model='vertex_ai/jamba-1.5-mini@001', messages)` |
-| jamba-1.5-large@001 | `completion(model='vertex_ai/jamba-1.5-large@001', messages)` |
+### Usage - Codestral FIM
-### Usage
+Call Codestral on VertexAI via the OpenAI [`/v1/completion`](https://platform.openai.com/docs/api-reference/completions/create) endpoint for FIM tasks.
+
+Note: You can also call Codestral via `/chat/completion`.
<Tabs>
<TabItem value="sdk" label="SDK">
@@ -999,19 +996,28 @@ curl --location 'http://0.0.0.0:4000/chat/completions' \
from litellm import completion
import os
-os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = ""
+# os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = ""
+# OR run `!gcloud auth print-access-token` in your terminal
-model = "meta/jamba-1.5-mini@001"
+model = "codestral@2405"
vertex_ai_project = "your-vertex-project" # can also set this as os.environ["VERTEXAI_PROJECT"]
vertex_ai_location = "your-vertex-location" # can also set this as os.environ["VERTEXAI_LOCATION"]
-response = completion(
+response = text_completion(
model="vertex_ai/" + model,
- messages=[{"role": "user", "content": "hi"}],
vertex_ai_project=vertex_ai_project,
vertex_ai_location=vertex_ai_location,
+ prompt="def is_odd(n): \n return n % 2 == 1 \ndef test_is_odd():",
+ suffix="return True", # optional
+ temperature=0, # optional
+ top_p=1, # optional
+ max_tokens=10, # optional
+ min_tokens=10, # optional
+ seed=10, # optional
+ stop=["return"], # optional
)
+
print("\nModel Response", response)
```
</TabItem>
@@ -1021,14 +1027,14 @@ print("\nModel Response", response)
```yaml
model_list:
- - model_name: jamba-1.5-mini
+ - model_name: vertex-codestral
litellm_params:
- model: vertex_ai/jamba-1.5-mini@001
+ model: vertex_ai/codestral@2405
vertex_ai_project: "my-test-project"
vertex_ai_location: "us-east-1"
- - model_name: jamba-1.5-large
+ - model_name: vertex-codestral
litellm_params:
- model: vertex_ai/jamba-1.5-large@001
+ model: vertex_ai/codestral@2405
vertex_ai_project: "my-test-project"
vertex_ai_location: "us-west-1"
```
@@ -1044,17 +1050,19 @@ litellm --config /path/to/config.yaml
**3. Test it!**
```bash
-curl --location 'http://0.0.0.0:4000/chat/completions' \
- --header 'Authorization: Bearer sk-1234' \
- --header 'Content-Type: application/json' \
- --data '{
- "model": "jamba-1.5-large",
- "messages": [
- {
- "role": "user",
- "content": "what llm are you"
- }
- ],
+curl -X POST 'http://0.0.0.0:4000/completions' \
+ -H 'Authorization: Bearer sk-1234' \
+ -H 'Content-Type: application/json' \
+ -d '{
+ "model": "vertex-codestral", # 👈 the 'model_name' in config
+ "prompt": "def is_odd(n): \n return n % 2 == 1 \ndef test_is_odd():",
+ "suffix":"return True", # optional
+ "temperature":0, # optional
+ "top_p":1, # optional
+ "max_tokens":10, # optional
+ "min_tokens":10, # optional
+ "seed":10, # optional
+ "stop":["return"], # optional
}'
```
@@ -1062,12 +1070,14 @@ curl --location 'http://0.0.0.0:4000/chat/completions' \
</Tabs>
+## AI21 Models
+
+| Model Name | Function Call |
+|------------------|--------------------------------------|
+| jamba-1.5-mini@001 | `completion(model='vertex_ai/jamba-1.5-mini@001', messages)` |
+| jamba-1.5-large@001 | `completion(model='vertex_ai/jamba-1.5-large@001', messages)` |
-### Usage - Codestral FIM
-
-Call Codestral on VertexAI via the OpenAI [`/v1/completion`](https://platform.openai.com/docs/api-reference/completions/create) endpoint for FIM tasks.
-
-Note: You can also call Codestral via `/chat/completion`.
+### Usage
<Tabs>
<TabItem value="sdk" label="SDK">
@@ -1076,28 +1086,19 @@ Note: You can also call Codestral via `/chat/completion`.
from litellm import completion
import os
-# os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = ""
-# OR run `!gcloud auth print-access-token` in your terminal
+os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = ""
-model = "codestral@2405"
+model = "meta/jamba-1.5-mini@001"
vertex_ai_project = "your-vertex-project" # can also set this as os.environ["VERTEXAI_PROJECT"]
vertex_ai_location = "your-vertex-location" # can also set this as os.environ["VERTEXAI_LOCATION"]
-response = text_completion(
+response = completion(
model="vertex_ai/" + model,
+ messages=[{"role": "user", "content": "hi"}],
vertex_ai_project=vertex_ai_project,
vertex_ai_location=vertex_ai_location,
- prompt="def is_odd(n): \n return n % 2 == 1 \ndef test_is_odd():",
- suffix="return True", # optional
- temperature=0, # optional
- top_p=1, # optional
- max_tokens=10, # optional
- min_tokens=10, # optional
- seed=10, # optional
- stop=["return"], # optional
)
-
print("\nModel Response", response)
```
</TabItem>
@@ -1107,14 +1108,14 @@ print("\nModel Response", response)
```yaml
model_list:
- - model_name: vertex-codestral
+ - model_name: jamba-1.5-mini
litellm_params:
- model: vertex_ai/codestral@2405
+ model: vertex_ai/jamba-1.5-mini@001
vertex_ai_project: "my-test-project"
vertex_ai_location: "us-east-1"
- - model_name: vertex-codestral
+ - model_name: jamba-1.5-large
litellm_params:
- model: vertex_ai/codestral@2405
+ model: vertex_ai/jamba-1.5-large@001
vertex_ai_project: "my-test-project"
vertex_ai_location: "us-west-1"
```
@@ -1130,19 +1131,17 @@ litellm --config /path/to/config.yaml
**3. Test it!**
```bash
-curl -X POST 'http://0.0.0.0:4000/completions' \
- -H 'Authorization: Bearer sk-1234' \
- -H 'Content-Type: application/json' \
- -d '{
- "model": "vertex-codestral", # 👈 the 'model_name' in config
- "prompt": "def is_odd(n): \n return n % 2 == 1 \ndef test_is_odd():",
- "suffix":"return True", # optional
- "temperature":0, # optional
- "top_p":1, # optional
- "max_tokens":10, # optional
- "min_tokens":10, # optional
- "seed":10, # optional
- "stop":["return"], # optional
+curl --location 'http://0.0.0.0:4000/chat/completions' \
+ --header 'Authorization: Bearer sk-1234' \
+ --header 'Content-Type: application/json' \
+ --data '{
+ "model": "jamba-1.5-large",
+ "messages": [
+ {
+ "role": "user",
+ "content": "what llm are you"
+ }
+ ],
}'
```