alpha
Login
or
Join now
aesth.lol
/
genue-ai-api
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
A api for Genue AI models. Self hosted.
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
Init git repo on existing project
author
scoopala7.tngl.sh
date
1 month ago
(Jun 17, 2026, 7:35 PM -0700)
commit
84d6462c
84d6462c521844d460e7657e8e733f6cf9f9a107
+46
3 changed files
Expand all
Collapse all
Unified
Split
.gitignore
app.py
requirements.txt
+3
.gitignore
View file
Reviewed
···
1
1
+
.env
2
2
+
__pycache__
3
3
+
.venv
+40
app.py
View file
Reviewed
···
1
1
+
from transformers import pipeline
2
2
+
from flask import app, request, make_response, Request
3
3
+
pipe = pipeline("text-generation", model="GenueAI/Geode-Onyx-2")
4
4
+
app = app.Flask("genue-api")
5
5
+
6
6
+
def _check_keys(request: Request):
7
7
+
keys = ["pixel1234pixel"]
8
8
+
for i,v in enumerate(keys):
9
9
+
if request.args.get("key", "") == v:
10
10
+
return True
11
11
+
return False
12
12
+
13
13
+
def _create_err(code: int):
14
14
+
if code == 401:
15
15
+
response = make_response("Invalid API key", 401)
16
16
+
response.mimetype = "text/plain"
17
17
+
return response
18
18
+
else:
19
19
+
response = make_response(f"An error occured. Code: {code}", code)
20
20
+
response.mimetype = "text/plain"
21
21
+
return response
22
22
+
23
23
+
def _get_completion(prompt):
24
24
+
messages = [
25
25
+
{"role": "system", "content": "You are Pixel, an AI chatbot running on Genue Geode Onyx 2."},
26
26
+
{"role": "user", "content": prompt},
27
27
+
]
28
28
+
message_returned = pipe(messages)[0]["generated_text"][2]["content"]
29
29
+
return message_returned
30
30
+
31
31
+
32
32
+
@app.route("/genue")
33
33
+
def genue_model_api():
34
34
+
if _check_keys(request):
35
35
+
completion = _get_completion("Hello! Who are you?")
36
36
+
response = make_response(completion, 200)
37
37
+
response.mimetype = "text/plain"
38
38
+
return response
39
39
+
else:
40
40
+
return _create_err(401)
+3
requirements.txt
View file
Reviewed
···
1
1
+
transformers
2
2
+
torch
3
3
+
flask[async]