this post was submitted on 08 Jun 2025
16 points (86.4% liked)

LocalLLaMA

3144 readers
21 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
 

I just set up a new dedicated AI server that is quite fast by my standards. I have it running with OpenWebUI and would like to integrate it with other services. I think it would be cool to have something like copilot where I can be writing code in a text editor and have it add a readme function or something like that. I have also used some RAG stuff and like it, but I think it would be cool to have a RAG that can access live data, like having the most up to date docker compose file and nginx configs for when I ask it about server stuff. So, what are you integrating your AI stuff with, and how can I get started?

you are viewing a single comment's thread
view the rest of the comments
[–] Smokeydope@lemmy.world 3 points 1 day ago* (last edited 1 day ago)

If your running into the issue of an app wanting an api key for your local ollamas openai-compatable web interface API and refuses to work without one, I found that any random characters work. If you port forward your host computer you should be able to access the webui interface on an external network using the public IP.

Heres the dead simple python program I used to send and recieve text to kobold.cpp engine through the web API. Not sure how similar ollama but afaik openai-compatable API means it all should works close to the same for compatibility(I think? lol!) if you give it a shot Make sure to set the .py file you make as executable and run it from a terminal doing ./filename.py to see the output in real time. It should make a log text file in same dir as the program too. Just use your host computers local ip if the python script pc is on same network.

spoiler

import requests

# Configuration
API_URL = "http://10.0.0.xx:5001/api/v1/generate"
PROMPT = "Tell me a short story about a robot learning to dance."
OUTPUT_FILE = "output.txt"

# Define the API request data
data = {
    "prompt": PROMPT,
    "max_length": 200,      # Adjust response length
    "temperature": 0.7,     # Control randomness (0=deterministic, 1=creative)
    "top_p": 0.9,           # Focus on high-probability tokens
}

# Send the request to kobold.cpp
response = requests.post(API_URL, json=data)

if response.status_code == 200:
    # Extract the generated text
    result = response.json()
    generated_text = result["results"][0]["text"]
    
    # Save to a text file
    with open(OUTPUT_FILE, "w") as f:
        f.write(generated_text)
    print(f"Response saved to {OUTPUT_FILE}!")
else:
    print(f"Error: {response.status_code} - {response.text}")