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

[FEATURE] Add Amazon SageMaker as a provider #1896

Closed
bobbywlindsey opened this issue Jan 14, 2025 · 2 comments · Fixed by #1947
Closed

[FEATURE] Add Amazon SageMaker as a provider #1896

bobbywlindsey opened this issue Jan 14, 2025 · 2 comments · Fixed by #1947
Labels
feature-request New feature or request

Comments

@bobbywlindsey
Copy link
Contributor

Feature Area

Documentation

Is your feature request related to a an existing bug? Please link it here.

NA

Describe the solution you'd like

  • Include SageMaker as a provider for LLMs with documented examples
  • Include SageMaker into the cli that bootstraps a new crewAI project

Describe alternatives you've considered

NA

Additional context

NA

Willingness to Contribute

Yes, I'd be happy to submit a pull request

@bobbywlindsey bobbywlindsey added the feature-request New feature or request label Jan 14, 2025
@dgallitelli
Copy link

+1 to this request. I've done a quick test and here are my findings:

  1. the CLI bootstrap has SageMaker as provider under "other" - select 10 first, then 31 for SageMaker
  2. To use it with the agents.yaml config, here is how:
replace-with-agent-name:
  role: [...]
  goal: [...]
  backstory: [...]
  llm: sagemaker_chat/replace-with-endpoint-name 
  # alternatively, if the model does not support the Messages API:
  # llm: sagemaker/replace-with-endpoint-name

What I could not figure out was how to use the agents.yaml file to:

  1. configure the AWS default region (had to go into the env vars manually)
  2. configure the max number of tokens or any other model parameter

Looking forward to official Crew.AI documentation on this very common use case!

@bobbywlindsey
Copy link
Contributor Author

+1 to this request. I've done a quick test and here are my findings:

  1. the CLI bootstrap has SageMaker as provider under "other" - select 10 first, then 31 for SageMaker
  2. To use it with the agents.yaml config, here is how:

replace-with-agent-name:
role: [...]
goal: [...]
backstory: [...]
llm: sagemaker_chat/replace-with-endpoint-name

alternatively, if the model does not support the Messages API:

llm: sagemaker/replace-with-endpoint-name

What I could not figure out was how to use the agents.yaml file to:

  1. configure the AWS default region (had to go into the env vars manually)
  2. configure the max number of tokens or any other model parameter

Looking forward to official Crew.AI documentation on this very common use case!

Good callouts 🔥 , I had similar findings as well. To configure model parameters, I found you can just update one of the Agents in the crew.py file like so:

Agent(
    config=self.agents_config['researcher'],
    verbose=True,
    llm=LLM(
        model="sagemaker/my-endpoint",
        temperature=0.6,
        top_p=0.9,
        details=True,
        max_new_tokens=1000,
        verbose=True
    )
)

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

Successfully merging a pull request may close this issue.

2 participants