I’m developing a small Python webapp as some sort of finger exercise. Mostly a chatbot. I’m using the Quart framework, which is pretty much alike Flask, just async. Now I want to connect that to a LLM inference endpoint. And while I could do the HTTP requests myself, I’d prefer something that does that for me. It should support the usual OpenAI style API, in the end I’d like it to connect to things like Ollama and KoboldCPP. No harm if it supports image generation, agents, tools, vector databases, but that’s optional.

I’ve tried Langchain, but I don’t think I like it very much. Are there other Python frameworks out there? What do you like? I’d prefer something relatively lightweigt that gets out of the way. Ideally provider agnostic, but I’m mainly looking for local solutions like the ones I mentioned.

Edit: Maybe something that also connects to a Runpod endpoint, to do inference on demand (later on)? Or at least something which I can adapt to that?

  • Oskar@piefed.social
    link
    fedilink
    English
    arrow-up
    3
    ·
    8 hours ago

    Ollama’s Python API works well and there’s a lot of examples. However, I’ve not gotten the Ollama REST API to work, the response doesn’t unpack into json for me.

    Just design the rest of your system so that it doesn’t have to know anything about the implementation (only prompts and responses) and you should be able to easily replace the LLM part later.