Add a new llm service that proxies chat-completion requests from AI web extensions to a configured OpenAI-compatible endpoint, replacing the standalone Node.js sidecar. It is part of the oCIS single binary, opt-in via OCIS_ADD_RUN_SERVICES=llm, and exposed through the proxy at POST /graph/v1beta1/extensions/org.libregraph/llm/chat/completions. Authentication is delegated to oCIS. Requests are rate-limited per user with a sliding window backed by the shared store, and the request body is sanitized before forwarding. Streaming requests are rejected. Signed-off-by: Lukas Hirt <info@hirt.cz>
19 lines
428 B
Go
19 lines
428 B
Go
// services/llm/pkg/logging/logging.go
|
|
package logging
|
|
|
|
import (
|
|
"github.com/owncloud/ocis/v2/ocis-pkg/log"
|
|
"github.com/owncloud/ocis/v2/services/llm/pkg/config"
|
|
)
|
|
|
|
// Configure initializes a service-specific logger instance.
|
|
func Configure(name string, cfg *config.Log) log.Logger {
|
|
return log.NewLogger(
|
|
log.Name(name),
|
|
log.Level(cfg.Level),
|
|
log.Pretty(cfg.Pretty),
|
|
log.Color(cfg.Color),
|
|
log.File(cfg.File),
|
|
)
|
|
}
|