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]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
Add sarvam doc
Sameer Kankutefaf9c9ba768a
diff --git a/docs/my-website/docs/providers/sarvam.md b/docs/my-website/docs/providers/sarvam.mdnew file mode 100644index 00000000000..d77e9c0c75f--- /dev/null+++ b/docs/my-website/docs/providers/sarvam.md@@ -0,0 +1,89 @@+# Sarvam.ai++LiteLLM supports all the text models from [Sarvam ai](https://docs.sarvam.ai/api-reference-docs/chat/chat-completions)++## Usage++```python+import os+from litellm import completion++# Set your Sarvam API key+os.environ["SARVAM_API_KEY"] = ""++messages = [{"role": "user", "content": "Hello"}]++response = completion(+ model="sarvam/sarvam-m",+ messages=messages,+)+print(response)+```++## Usage with LiteLLM Proxy Server++Here's how to call a Sarvam.ai model with the LiteLLM Proxy Server++1. **Modify the `config.yaml`:**++ ```yaml+ model_list:+ - model_name: my-model+ litellm_params:+ model: sarvam/<your-model-name> # add sarvam/ prefix to route as Sarvam provider+ api_key: api-key # api key to send your model+ ```++2. **Start the proxy:**++ ```bash+ $ litellm --config /path/to/config.yaml+ ```++3. **Send a request to LiteLLM Proxy Server:**++ <Tabs>++ <TabItem value="openai" label="OpenAI Python v1.0.0+">++ ```python+ import openai++ client = openai.OpenAI(+ api_key="sk-1234", # pass litellm proxy key, if you're using virtual keys+ base_url="http://0.0.0.0:4000" # litellm-proxy-base url+ )++ response = client.chat.completions.create(+ model="my-model",+ messages=[+ {+ "role": "user",+ "content": "what llm are you"+ }+ ],+ )++ print(response)+ ```+ </TabItem>++ <TabItem value="curl" label="curl">++ ```shell+ curl --location 'http://0.0.0.0:4000/chat/completions' \+ --header 'Authorization: Bearer sk-1234' \+ --header 'Content-Type: application/json' \+ --data '{+ "model": "my-model",+ "messages": [+ {+ "role": "user",+ "content": "what llm are you"+ }+ ]+ }'+ ```+ </TabItem>++ </Tabs>diff --git a/docs/my-website/sidebars.js b/docs/my-website/sidebars.jsindex 85573599e44..41854a41777 100644--- a/docs/my-website/sidebars.js+++ b/docs/my-website/sidebars.js@@ -775,6 +775,7 @@ const sidebars = {"providers/oci","providers/ollama","providers/openrouter",+ "providers/sarvam","providers/ovhcloud","providers/perplexity","providers/petals",