Skip to content

Commit

Permalink
Add Azure OpenAI
Browse files Browse the repository at this point in the history
  • Loading branch information
aymeric-roucher committed Jan 31, 2025
1 parent 99a4436 commit fe597f6
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ Our library is LLM-agnostic: you could switch the example above to any inference

<details>
<summary> <b>4+ inference providers via HfApiModel</b></summary>

```py
from smolagents import HfApiModel

Expand All @@ -88,6 +89,7 @@ model = HfApiModel(
</details>
<details>
<summary> <b>Any LLM via [LiteLLM](litellm.ai)</b></summary>

```py
from smolagents import LiteLLMModel

Expand All @@ -100,6 +102,7 @@ model = LiteLLMModel(
</details>
<details>
<summary> <b>OpenAI chat server</b></summary>

```py
from smolagents import OpenAIServerModel

Expand All @@ -112,12 +115,29 @@ model = OpenAIServerModel(
</details>
<details>
<summary> <b>Local `transformers` model</b></summary>

```py
from smolagents import TransformersModel

model = TransformersModel(model_id="Qwen/Qwen2.5-Coder-32B-Instruct", max_new_tokens=4096)
```
</details>
<details>
<summary> <b>Azure models</b></summary>

```py
import os

from smolagents import AzureOpenAIServerModel

model = AzureOpenAIServerModel(
model_id = os.environ.get("AZURE_OPENAI_MODEL"),
azure_endpoint=os.environ.get("AZURE_OPENAI_ENDPOINT"),
api_key=os.environ.get("AZURE_OPENAI_API_KEY"),
api_version=os.environ.get("OPENAI_API_VERSION")
)
```
</details>

## Command Line Interface

Expand Down

0 comments on commit fe597f6

Please sign in to comment.