A api for Genue AI models. Self hosted.
0

Configure Feed

Select the types of activity you want to include in your feed.

Init git repo on existing project

author
scoopala7.tngl.sh
date (Jun 17, 2026, 7:35 PM -0700) commit 84d6462c
+46
+3
.gitignore
··· 1 + .env 2 + __pycache__ 3 + .venv
+40
app.py
··· 1 + from transformers import pipeline 2 + from flask import app, request, make_response, Request 3 + pipe = pipeline("text-generation", model="GenueAI/Geode-Onyx-2") 4 + app = app.Flask("genue-api") 5 + 6 + def _check_keys(request: Request): 7 + keys = ["pixel1234pixel"] 8 + for i,v in enumerate(keys): 9 + if request.args.get("key", "") == v: 10 + return True 11 + return False 12 + 13 + def _create_err(code: int): 14 + if code == 401: 15 + response = make_response("Invalid API key", 401) 16 + response.mimetype = "text/plain" 17 + return response 18 + else: 19 + response = make_response(f"An error occured. Code: {code}", code) 20 + response.mimetype = "text/plain" 21 + return response 22 + 23 + def _get_completion(prompt): 24 + messages = [ 25 + {"role": "system", "content": "You are Pixel, an AI chatbot running on Genue Geode Onyx 2."}, 26 + {"role": "user", "content": prompt}, 27 + ] 28 + message_returned = pipe(messages)[0]["generated_text"][2]["content"] 29 + return message_returned 30 + 31 + 32 + @app.route("/genue") 33 + def genue_model_api(): 34 + if _check_keys(request): 35 + completion = _get_completion("Hello! Who are you?") 36 + response = make_response(completion, 200) 37 + response.mimetype = "text/plain" 38 + return response 39 + else: 40 + return _create_err(401)
+3
requirements.txt
··· 1 + transformers 2 + torch 3 + flask[async]