Add OpenAI-compatible endpoints and instance creation timestamp

This commit is contained in:
2025-07-27 12:07:33 +02:00
parent 1261232baa
commit e6652e52e1
7 changed files with 408 additions and 0 deletions

View File

@@ -10,6 +10,7 @@ import (
"net/url"
"os/exec"
"sync"
"time"
)
type CreateInstanceOptions struct {
@@ -60,6 +61,9 @@ type Instance struct {
// Status
Running bool `json:"running"`
// Creation time
Created int64 `json:"created,omitempty"` // Unix timestamp when the instance was created
// Logging file
logger *InstanceLogger `json:"-"`
@@ -153,6 +157,8 @@ func NewInstance(name string, globalSettings *InstancesConfig, options *CreateIn
logger: logger,
Running: false,
Created: time.Now().Unix(),
}
}