Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sambanova models support #215

Closed
wants to merge 18 commits into from

Conversation

jhpiedrahitao
Copy link

PR implementing SambaNovaModel and allowing access to SambaNovaCloudModels.
includes, model, base tests and docs

Copy link
Contributor

@hyperlint-ai hyperlint-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 files reviewed, 1 total issue(s) found.

docs/install.md Show resolved Hide resolved
@samuelcolvin
Copy link
Member

Hi @jhpiedrahitao, I've never heard of Sambanova. Please can you start by creating an issue and see if we get significant interest from the community, before we consider adding this to pydantic-ai itself.

Alternatively if you want to use or even distribute this without waiting, you can always create a new package, e.g. pyantic-ai-sambanova which has pydantic-ai as a dependency, and exposes SambaNovaModel.

@sambarnes
Copy link
Contributor

sambarnes commented Dec 11, 2024

Hi @jhpiedrahitao, I've never heard of Sambanova. Please can you start by creating an issue and see if we get significant interest from the community, before we consider adding this to pydantic-ai itself.

we've got a number of sambanova provided models at openrouter, and there is support for that already in pydantic-ai

i actually just saw this recent issue, after hearing users ask if it works with our services:
#139

would you be open to a quick docs pr adding another example at the end of here?

from openai import AsyncOpenAI

from pydantic_ai import Agent
from pydantic_ai.models.openai import OpenAIModel

client = AsyncOpenAI(
  base_url='https://openrouter.ai/api/v1',
  api_key='your-api-key',
)
model = OpenAIModel('anthropic/claude-3.5-sonnet', openai_client=client)
agent = Agent(model)
...

we're considering making pydantic-ai the default in our quickstart docs as well, considering a lot of people really love the devx so far

@jhpiedrahitao
Copy link
Author

Hi @jhpiedrahitao, I've never heard of Sambanova. Please can you start by creating an issue and see if we get significant interest from the community, before we consider adding this to pydantic-ai itself.

Alternatively if you want to use or even distribute this without waiting, you can always create a new package, e.g. pyantic-ai-sambanova which has pydantic-ai as a dependency, and exposes SambaNovaModel.

Hi @samuelcolvin I created the issue here #218

You can find more information here https://sambanova.ai/
also in the issue linked to artificial analysis providers leader board, where you can see SambaNova being on top for several models

@samuelcolvin
Copy link
Member

@sambarnes definitely happy to add that example to the docs. I also think we could add base_url as a kwarg to OpenAIModel so you can simplify it to just

model = OpenAIModel(
    'anthropic/claude-3.5-sonnet',
  base_url='https://openrouter.ai/api/v1',
  api_key='your-api-key',
)

PR welcome to add that.

@@ -383,3 +383,50 @@ agent = Agent(model)
To use [Ollama](https://ollama.com/), you must first download the Ollama client, and then download a model.

You must also ensure the Ollama server is running when trying to make requests to it. For more information, please see the [Ollama documentation](https://github.com/ollama/ollama/tree/main/docs)

### SambaNova

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may also need to add Sambanova LLM API to the list at the top of this document:

This installs the pydantic_ai package, core dependencies, and libraries required to use the following LLM APIs:

@samuelcolvin
Copy link
Member

Closing as per #218 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants