chore: rename project and all references to qorona
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// q38max: Standalone OpenAI-compatible gateway for Qwen 3.8 Max HuggingFace Spaces
|
||||
// qorona: Standalone OpenAI-compatible gateway for Qwen 3.8 Max HuggingFace Spaces
|
||||
// Created by Luxferre in 2026, released into the public domain
|
||||
|
||||
package main
|
||||
@@ -1086,7 +1086,7 @@ func PrepareConversation(req ChatCompletionRequest) (history []map[string]interf
|
||||
// Main Gateway Service
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
type Q38Gateway struct {
|
||||
type QoronaGateway struct {
|
||||
spaceURL string
|
||||
samplePath string
|
||||
modelID string
|
||||
@@ -1094,7 +1094,7 @@ type Q38Gateway struct {
|
||||
sessionMgr *FiftyOneSessionManager
|
||||
}
|
||||
|
||||
func NewQ38Gateway(spaceURL string, samplePath string, modelID string, timeout time.Duration) *Q38Gateway {
|
||||
func NewQoronaGateway(spaceURL string, samplePath string, modelID string, timeout time.Duration) *QoronaGateway {
|
||||
tr := &http.Transport{
|
||||
MaxIdleConns: 100,
|
||||
MaxIdleConnsPerHost: 20,
|
||||
@@ -1104,7 +1104,7 @@ func NewQ38Gateway(spaceURL string, samplePath string, modelID string, timeout t
|
||||
Transport: tr,
|
||||
Timeout: timeout,
|
||||
}
|
||||
return &Q38Gateway{
|
||||
return &QoronaGateway{
|
||||
spaceURL: strings.TrimRight(spaceURL, "/"),
|
||||
samplePath: samplePath,
|
||||
modelID: modelID,
|
||||
@@ -1113,7 +1113,7 @@ func NewQ38Gateway(spaceURL string, samplePath string, modelID string, timeout t
|
||||
}
|
||||
}
|
||||
|
||||
func (gw *Q38Gateway) HandleModels(w http.ResponseWriter, r *http.Request) {
|
||||
func (gw *QoronaGateway) HandleModels(w http.ResponseWriter, r *http.Request) {
|
||||
EnableCORS(w)
|
||||
if r.Method == http.MethodOptions {
|
||||
w.WriteHeader(http.StatusNoContent)
|
||||
@@ -1130,6 +1130,18 @@ func (gw *Q38Gateway) HandleModels(w http.ResponseWriter, r *http.Request) {
|
||||
Created: now,
|
||||
OwnedBy: "qwen",
|
||||
},
|
||||
{
|
||||
ID: "qorona",
|
||||
Object: "model",
|
||||
Created: now,
|
||||
OwnedBy: "qwen",
|
||||
},
|
||||
{
|
||||
ID: "qwen-3.8-max",
|
||||
Object: "model",
|
||||
Created: now,
|
||||
OwnedBy: "qwen",
|
||||
},
|
||||
{
|
||||
ID: "qwen3.8-max",
|
||||
Object: "model",
|
||||
@@ -1155,7 +1167,7 @@ func (gw *Q38Gateway) HandleModels(w http.ResponseWriter, r *http.Request) {
|
||||
json.NewEncoder(w).Encode(resp)
|
||||
}
|
||||
|
||||
func (gw *Q38Gateway) HandleChatCompletions(w http.ResponseWriter, r *http.Request) {
|
||||
func (gw *QoronaGateway) HandleChatCompletions(w http.ResponseWriter, r *http.Request) {
|
||||
EnableCORS(w)
|
||||
if r.Method == http.MethodOptions {
|
||||
w.WriteHeader(http.StatusNoContent)
|
||||
@@ -1599,7 +1611,7 @@ func main() {
|
||||
ConfiguredToken = *hfToken
|
||||
}
|
||||
|
||||
gw := NewQ38Gateway(*spaceURL, *samplePath, *modelID, time.Duration(*timeoutSec)*time.Second)
|
||||
gw := NewQoronaGateway(*spaceURL, *samplePath, *modelID, time.Duration(*timeoutSec)*time.Second)
|
||||
|
||||
mux := http.NewServeMux()
|
||||
|
||||
@@ -1613,28 +1625,28 @@ func main() {
|
||||
mux.HandleFunc("/__health", func(w http.ResponseWriter, r *http.Request) {
|
||||
EnableCORS(w)
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.Write([]byte(`{"status":"ok","gateway":"q38max"}`))
|
||||
w.Write([]byte(`{"status":"ok","gateway":"qorona"}`))
|
||||
})
|
||||
mux.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) {
|
||||
EnableCORS(w)
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.Write([]byte(`{"status":"ok","gateway":"q38max"}`))
|
||||
w.Write([]byte(`{"status":"ok","gateway":"qorona"}`))
|
||||
})
|
||||
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
EnableCORS(w)
|
||||
if r.URL.Path == "/" {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.Write([]byte(`{"service":"q38max","description":"OpenAI-compatible gateway for Qwen 3.8 Max","models_endpoint":"/v1/models","completions_endpoint":"/v1/chat/completions"}`))
|
||||
w.Write([]byte(`{"service":"qorona","description":"OpenAI-compatible gateway for Qwen 3.8 Max","models_endpoint":"/v1/models","completions_endpoint":"/v1/chat/completions"}`))
|
||||
return
|
||||
}
|
||||
http.NotFound(w, r)
|
||||
})
|
||||
|
||||
addr := fmt.Sprintf(":%d", *port)
|
||||
log.Printf("[q38max] Listening on http://localhost%s (Upstream: %s)", addr, *spaceURL)
|
||||
log.Printf("[q38max] OpenAI compatible endpoints: http://localhost%s/v1/chat/completions", addr)
|
||||
log.Printf("[qorona] Listening on http://localhost%s (Upstream: %s)", addr, *spaceURL)
|
||||
log.Printf("[qorona] OpenAI compatible endpoints: http://localhost%s/v1/chat/completions", addr)
|
||||
|
||||
if err := http.ListenAndServe(addr, mux); err != nil {
|
||||
log.Fatalf("[q38max] Server failed: %v", err)
|
||||
log.Fatalf("[qorona] Server failed: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user