From 6f6f9bf58e326ce8941fa90a9ea24fa0c6b5892f Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Sat, 7 Jun 2025 17:22:18 -0700 Subject: [PATCH] docs cleanup --- docs/my-website/docs/anthropic_unified.md | 79 +---------------------- 1 file changed, 2 insertions(+), 77 deletions(-) diff --git a/docs/my-website/docs/anthropic_unified.md b/docs/my-website/docs/anthropic_unified.md index 404c1675b8..d4660bf070 100644 --- a/docs/my-website/docs/anthropic_unified.md +++ b/docs/my-website/docs/anthropic_unified.md @@ -90,44 +90,7 @@ async for chunk in response: - - -#### Non-streaming example -```python showLineNumbers title="OpenAI o1-pro Example using LiteLLM Python SDK" -import litellm -import os - -# Set API key -os.environ["OPENAI_API_KEY"] = "your-openai-api-key" - -response = await litellm.anthropic.messages.acreate( - messages=[{"role": "user", "content": "Solve this math problem: What is the derivative of x^3 + 2x^2 - 5x + 1?"}], - model="openai/o1-pro", - max_tokens=500, -) -``` - -#### Streaming example -```python showLineNumbers title="OpenAI o1-pro Streaming Example using LiteLLM Python SDK" -import litellm -import os - -# Set API key -os.environ["OPENAI_API_KEY"] = "your-openai-api-key" - -response = await litellm.anthropic.messages.acreate( - messages=[{"role": "user", "content": "Solve this math problem: What is the derivative of x^3 + 2x^2 - 5x + 1?"}], - model="openai/o1-pro", - max_tokens=500, - stream=True, -) -async for chunk in response: - print(chunk) -``` - - - - + #### Non-streaming example ```python showLineNumbers title="Google Gemini Example using LiteLLM Python SDK" @@ -350,45 +313,7 @@ response = client.messages.create( - - -1. Setup config.yaml - -```yaml -model_list: - - model_name: openai-o1-pro - litellm_params: - model: openai/o1-pro - api_key: os.environ/OPENAI_API_KEY -``` - -2. Start proxy - -```bash -litellm --config /path/to/config.yaml -``` - -3. Test it! - -```python showLineNumbers title="OpenAI o1-pro Example using LiteLLM Proxy Server" -import anthropic - -# point anthropic sdk to litellm proxy -client = anthropic.Anthropic( - base_url="http://0.0.0.0:4000", - api_key="sk-1234", -) - -response = client.messages.create( - messages=[{"role": "user", "content": "Solve this math problem: What is the derivative of x^3 + 2x^2 - 5x + 1?"}], - model="openai-o1-pro", - max_tokens=500, -) -``` - - - - + 1. Setup config.yaml