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 ollama? #25

Open
adsharma opened this issue Jan 7, 2025 · 0 comments
Open

Support ollama? #25

adsharma opened this issue Jan 7, 2025 · 0 comments

Comments

@adsharma
Copy link

adsharma commented Jan 7, 2025

I tried to use a local LLM as follows:

import asyncio
from langchain_ollama import OllamaLLM

from langchain_prefect.plugins import RecordLLMCalls

llm = OllamaLLM(model="qwen2.5:latest")


async def record_call_using_LLM_agenerate():
    """async func"""
    await llm.agenerate(
        [
            "What would be a good name for a company that makes colorful socks?",
            "What would be a good name for a company that sells carbonated water?",
        ]
    )


with RecordLLMCalls():
    asyncio.run(record_call_using_LLM_agenerate())

The code fails when you try to patch the generate method due to assumptions about the inheritance hierarchy.

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

1 participant