agno icon indicating copy to clipboard operation
agno copied to clipboard

Add anyscale models

Open ashpreetbedi opened this issue 2 years ago • 3 comments

Add anyscale as a new LLM provider.

ashpreetbedi avatar Jan 26 '24 13:01 ashpreetbedi

Hello! I am Shantanav. I am a beginner in open source contribution and I see this issue is labeled as a good first issue. I am interested in contributing to this repository. I will really appreciate any help in order to understand the issue and contribute to it. Thanks!

shantanavKapse avatar Feb 10 '24 17:02 shantanavKapse

Hi @shantanavKapse, thank you for your help here. We'd like to add anyscale as an api provider. The task is as simple as:

  • Creating a new file phi/llm/anyscale/anyscale.py by copying this file: https://github.com/phidatahq/phidata/blob/main/phi/llm/together/together.py.

It would look like:

from os import getenv
from typing import Optional

from phi.llm.openai.like import OpenAILike


class Anyscale(OpenAILike):
    name: str = "Anyscale"
    model: str = "meta-llama/Llama-2-70b-chat-hf"
    api_key: Optional[str] = getenv("ANYSCALE_ENDPOINT_API_KEY")
    base_url: str = "https://api.endpoints.anyscale.com/v1"
  • Then creating a cookbook like this: https://github.com/phidatahq/phidata/tree/main/cookbook/together for anyscale

Here's more information:

You'll need an anyscale account to test: https://docs.endpoints.anyscale.com

They'll give you $10 of credits, if you need more -- i'm happy to give you my key which you can continue building with.

Happy to answer more questions, but this is mostly just:

  • Creating an LLM provider for Anyscale
  • Create a cookbook where you test the LLM
  • Submitting a PR 🥳 🎉

ashpreetbedi avatar Feb 10 '24 18:02 ashpreetbedi

Thank you @ashpreetbedi for guiding me through the issue. I really appreciate your help.

shantanavKapse avatar Feb 11 '24 13:02 shantanavKapse