5
submitted 2 months ago* (last edited 2 months ago) by hendrik@palaver.p3x.de to c/localllama@sh.itjust.works

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?

top 4 comments
sorted by: hot top controversial new old
[-] Oskar@piefed.social 3 points 2 months 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.

[-] bjoern_tantau@swg-empire.de 2 points 2 months ago

Ollama has their own Python library linked on their website.

[-] ryedaft@sh.itjust.works 2 points 2 months ago

Try Simon Willison's LLM library. Python and command line connection to LLMs, local or remote. Lots of blog posts about how to do various things. Also image examples.

https://github.com/simonw/llm

[-] hendrik@palaver.p3x.de 2 points 2 months ago

Thanks to all who sent suggestions, I think I'll try this one first. Looks quite neat and ticks all the boxes. If the async plugin does it's job, I can use that.

this post was submitted on 16 Mar 2025
5 points (85.7% liked)

LocalLLaMA

2978 readers
10 users here now

Welcome to LocalLLaMA! Here we discuss running and developing machine learning models at home. Lets explore cutting edge open source neural network technology together.

Get support from the community! Ask questions, share prompts, discuss benchmarks, get hyped at the latest and greatest model releases! Enjoy talking about our awesome hobby.

As ambassadors of the self-hosting machine learning community, we strive to support each other and share our enthusiasm in a positive constructive way.

Rules:

Rule 1 - No harassment or personal character attacks of community members. I.E no namecalling, no generalizing entire groups of people that make up our community, no baseless personal insults.

Rule 2 - No comparing artificial intelligence/machine learning models to cryptocurrency. I.E no comparing the usefulness of models to that of NFTs, no comparing the resource usage required to train a model is anything close to maintaining a blockchain/ mining for crypto, no implying its just a fad/bubble that will leave people with nothing of value when it burst.

Rule 3 - No comparing artificial intelligence/machine learning to simple text prediction algorithms. I.E statements such as "llms are basically just simple text predictions like what your phone keyboard autocorrect uses, and they're still using the same algorithms since <over 10 years ago>.

Rule 4 - No implying that models are devoid of purpose or potential for enriching peoples lives.

founded 2 years ago
MODERATORS