-
Notifications
You must be signed in to change notification settings - Fork 6
/
config.toml
80 lines (65 loc) · 2.77 KB
/
config.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# The IP address and port that the server will bind to
bind = "0.0.0.0:8080"
# The API keys for OpenAI. You can add multiple keys as needed.
api_keys = [""]
# The organization ID for OpenAI. Uncomment and fill in if applicable.
# organization = ""
# The base URL for the OpenAI API. The default is OpenAI's official API.
# Uncomment and replace with your own endpoint if needed.
# api_base = "https://api.openai.com/v1" # default
# api_base = "https://example-endpoint.openai.azure.com"
# The type of the API. By default, it's set to OpenAI's official API.
# Uncomment and replace as needed for other API types.
# api_type = "open_ai" # default
# api_type = "azure"
# api_type = "azure_ad"
# The version of the API. Uncomment and fill in if using Azure.
# api_version = "2023-05-15" # uncomment when using azure
# Uncomment the following section to enable JWT authentication.
# Provide the secret for JWT token generation and verification.
# [jwt-auth]
# secret = "some-secret"
# The audit configuration.
# Specifies where and how access logs should be stored.
[audit]
backend = "file" # possible backends: file, sqlite, mysql, postgres
[audit.filters.access]
enable = true # enable this filter
method = true # log request method
uri = true # log request origin uri
headers = true # log request origin headers
body = true # log request body (be careful when enable with file upload apis (like audio, files))
response = true # log openai response
[audit.filters.tokens]
enable = true # enable this filter
# logging tokens on thoses endpoints
endpoints = ["/completions", "/chat/completions", "/edits", "/embeddings"]
# openai api won't return token consumption in stream mode
# skip: skip calcuate token consumption for stream request
# reject: reject stream request
# estimate: estimate the token consumption using tiktoken (may be inaccurate)
stream_tokens = "estimate"
# For file backend, specify the file path for the access log.
[audit.backends.file]
filename = "access.log"
# For SQLite backend, specify the SQLite database file path.
# [audit.backends.sqlite]
# filename = "audit.sqlite"
# For MySQL backend, specify the host, port, and optional socket for a MySQL database,
# as well as the username, password, and database name for access log storage.
# [audit.backends.mysql]
# host = "localhost"
# port = 3306
# socket = "/var/run/mysqld/mysqld.sock" # using UNIX socket instead of TCP
# username = "username"
# password = "password"
# database = "access_log"
# For PostgreSQL backend, specify the host, port, and socket for a PostgreSQL database,
# as well as the username, password, and database name for access log storage.
# [audit.backends.postgres]
# host = "localhost"
# port = 5432
# socket = "/var/run/postgresql/.s.PGSQL.5432"
# username = "postgres"
# password = "password"
# database = "access_log"