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

Support for Cerebras #1478

Open
mridula-plivo opened this issue Nov 21, 2024 · 3 comments
Open

Support for Cerebras #1478

mridula-plivo opened this issue Nov 21, 2024 · 3 comments

Comments

@mridula-plivo
Copy link

Can you also add support for AI inference with Cerebras?

https://inference-docs.cerebras.ai/introduction?_gl=1*1bp8hjp*_ga*NTgyNDE2ODgyLjE3MzIxMDY5MTM.*_ga_M90K89G16V*MTczMjE2NTE4My4yLjEuMTczMjE2NTQyMy4wLjAuMA..

@manthanguptaa
Copy link
Contributor

Thank you so much @mridula-plivo for suggesting Cerebras AI inference support! It's really valuable when our users share ideas for integrations that could make our product more powerful. I've noted this suggestion and will share it internally with the team.

@mridula-plivo
Copy link
Author

Hey @manthanguptaa . Did you get a chance to discuss this with your team? Any ETA?

@LuisYordano
Copy link

Hi @mridula-plivo, You can run the Cerebras API with the following Code Snippet:

from os import getenv
from phi.agent import Agent, RunResponse
from phi.model.openai.like import OpenAILike

agent = Agent(
    model=OpenAILike(
        id="llama-3.3-70b",
        api_key=getenv("CEREBRAS_API_KEY"),
        base_url="https://api.cerebras.ai/v1",
    )
)

# Get the response in a variable
# run: RunResponse = agent.run("Share a 2 sentence horror story.")
# print(run.content)

# Print the response in the terminal
agent.print_response("Share a 2 sentence horror story.")

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

No branches or pull requests

3 participants