stanfordnlp / dspy

DSPy: The framework for programming—not prompting—foundation models
https://dspy-docs.vercel.app/
MIT License
16.77k stars 1.3k forks source link

Does dspy.GROQ actually works? #1459

Closed simplexityware closed 6 days ago

simplexityware commented 1 week ago

according to https://dspy-docs.vercel.app/api/language_model_clients/Groq

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
[<ipython-input-2-d7f5c6b1fffa>](https://localhost:8080/#) in <cell line: 12>()
     10 # )
     11 
---> 12 llm = dspy.GROQ(model="llama-3.1-70b-versatile", api_key = GROQ_API_KEY )
     13 dspy.settings.configure(lm=llm)

AttributeError: module 'dspy' has no attribute 'GROQ'

I am really keen to complete this tutorial using the free GROQ/LLama3 service in the cloud - https://github.com/stanfordnlp/dspy/blob/main/examples/llamaindex/dspy_llamaindex_rag.ipynb - to use as a reference for other projects involving the use of DSPy and LlamaIndex.

Thank you for your kind attention.

hacker-4-good commented 1 week ago

@simplexityware use dspy.GroqLM(model="llama-3.1-70b-versatile", api_key = GROQ_API_KEY)

Requirements :- pip install groq

codebase link for GroqLM :- GroqLM

below is the screenshot of GroqLM class for reference image

okhat commented 6 days ago

fixed by recent PR, thanks @hacker-4-good

simplexityware commented 4 days ago

@simplexityware use dspy.GroqLM(model="llama-3.1-70b-versatile", api_key = GROQ_API_KEY)

Requirements :- pip install groq

codebase link for GroqLM :- GroqLM

below is the screenshot of GroqLM class for reference image

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
[<ipython-input-2-03daf97e6575>](https://localhost:8080/#) in <cell line: 12>()
     10 # )
     11 
---> 12 llm = dspy.GroqLM(model="llama-3.1-70b-versatile", api_key = GROQ_API_KEY )
     13 dspy.settings.configure(lm=llm)

AttributeError: module 'dspy' has no attribute 'GroqLM'