-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathexample.config.toml
More file actions
174 lines (153 loc) · 9.8 KB
/
example.config.toml
File metadata and controls
174 lines (153 loc) · 9.8 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# DO NOT EDIT THIS FILE DIRECTLY MAKE A COPY OF IT AND RENAME IT TO config.toml
# DO NOT EDIT THIS FILE DIRECTLY MAKE A COPY OF IT AND RENAME IT TO config.toml
# DO NOT EDIT THIS FILE DIRECTLY MAKE A COPY OF IT AND RENAME IT TO config.toml
# (or run the program and it will generate config.toml for you)
[server]
mastodon_server = "https://mastodon.example.com" # Your Mastodon server URL
client_secret = "your_client_secret" # Your Mastodon App client secret
access_token = "your_access_token" # Your Mastodon App access token
username = "your_bot_username" # Your Mastodon bot's username
[llm]
provider = "gemini" # can be "gemini", "ollama", or "transformers"
ollama_model = "llava-phi3"
ollama_keep_alive = "5m" # Keep model loaded in RAM. Use "-1" for persistent serving, "0" for immediate unload, or duration like "5m". Good for active instances.
ollama_translation_model = "" # Optional: Use a separate model for translation (e.g., "gemma3:4b-it-q4_K_M"). Leave empty to use the same model as ollama_model.
ollama_translation_keep_alive = "" # Keep-alive for translation model. Defaults to ollama_keep_alive if not set.
use_translation_layer = true # Enable translation layer for local LLMs (generates alt-text in English, then translates)
prompt_additional_instructions = "" # Additional instructions to be added to the prompt (Note: The same instructions will be added to every language)
prompt_override = "" # WARNING: This will override the prompt making the bot only generate alt-text in one language
[transformers]
model = "AIDC-AI/Ovis2-4B"
port = 8000
device = "cuda"
max_memory = 0.9 # 90% of GPU memory
torch_dtype = "bfloat16"
[gemini]
api_key = "your_gemini_api_key" # Replace with your Gemini API key, if you don't have one, you can get it from https://aistudio.google.com/app/apikey
model = "gemini-1.5-flash" # or "gemini-1.5-pro" Note: "gemini-1.5-pro" allows for only 2 Requests per Minute while "gemini-1.5-flash" allows for 15 Requests per Minute
temperature = 0.7
top_k = 1
# Thresholds for the content moderation, setting them to another value than "none" will enable the content moderation may brake some responses
# Can be set to "none", "low", "medium", "high"
harassment_threshold = "none"
hate_speech_threshold = "none"
sexually_explicit_threshold = "none"
dangerous_content_threshold = "none"
[openai]
base_url = "your_custom_openai_endpoint" # Replace with your openai compatible endpoint or remove to use OpenAI
api_key = "your_openai_key"
model = "gpt-4o-mini"
[localization]
# Default language for the bot
default_language = "en"
[dni]
# List of profile tags that will make the bot ignore the user
tags = ["#nobot", "#noai", "#nollm"]
# Should the bot ignore other automated accounts
ignore_bots = true
[image_processing]
# Greater values may break the image processing due to haivng a size greater than the maximum allowed by the API
downscale_width = 800
max_size_mb = 50 # Maximum file size in MB for to be processed (Images and Audio)
[video_processing]
max_size_mb = 100 # Maximum file size in MB for to be processed (Video only)
num_frames_per_second = 1 # Number of frames to extract from the video
max_frames = 30 # Maximum number of frames to extract from the video
[behavior]
# Maximum visibility of the replies to the bot, can be "public", "unlisted", "private" or "direct"
reply_visibility = "unlisted"
# Follow back new followers
follow_back = true
# Ask for consent when mentioned by none OP users
ask_for_consent = true
# URL to the privacy policy (leave empty to use the default Altbot privacy policy)
privacy_policy_url = ""
[rate_limit]
enabled = true # Enable or disable rate limiting
max_requests_per_user_per_minute = 4
max_requests_per_user_per_hour = 20
new_account_max_requests_per_minute = 4
new_account_max_requests_per_hour = 10
new_account_period_days = 7 # How long to consider an account as "new" for rate limiting purposes
shadow_ban_threshold = 10 # Number of exceeded attempts before shadow banning
admin_contact_handle = "@admin" # Fedi handle of the bot's administrator
[profile]
enabled = true
override_field_count = false # Set to true to remove the 4 feild limit, if using glitch-soc or other software that supports more fields
# Order matters! First items have priority
# Available fields: "version", "model", "source", "donate", "made-by"
fields = ["made-by", "version", "model", "source", "donate"]
[api]
enabled = false
port = 8081 # Different from dashboard port
monthly_limit = 5000 # Images per month per key
kofi_verification_token = "" # Get this from Ko-fi webhook settings (leave empty to disable webhook)
kofi_shop_item_code = "a2d4aabd54"
kofi_tier_name = "Altbot Unlimited API Key"
postmark_token = "arskayuthluahtulhfwtuwfht"
postmark_from_email = "api@altbot.micr0.dev"
[metrics]
enabled = true # Set to false to completely disable all metrics collection and logging
dashboard_enabled = true # Set to false to disable the metrics dashboard
dashboard_port = 8080 # Port for the metrics dashboard
[power_metrics]
enabled = true # Whether to show power consumption
gpu_watts = 75 # Constant power consumption in watts
show_comparison = true # Whether to show comparison to cloud AI
cloud_kwh_per_request = 0.0005 # Estimated kWh per request for cloud AI
[alt_text_reminders]
enabled = true # Enable or disable the alt-text reminder feature
reminder_time = 10 # How long to wait before reminding users to add alt-text to their images (in minutes) if they haven't already
[weekly_summary]
enabled = true # Enable or disable the weekly summary feature (disabling will prevent all built-in Logging as well)
post_day = "Sunday" # Day of the week to post the summary
post_time = "12:00" # Time of day to post the summary (24-hour format)
message_template = """
🌟 **Weekly Altbot Summary** 🌟
- **Alt-Texts Generated**: {{alt_text_count}}
- **New Users**: {{new_user_count}}
🏆 **Leaderboard for Human-Written Alt-Texts** 🏆
{{leaderboard}}
**Tip of the Week**: {{tip_of_the_week}}
Thank you for helping make the Fediverse more accessible!
"""
tips = [
"Always review the alt-text generated by Altbot to ensure it accurately describes the image.",
"An alt-text is better than no alt-text! Use Altbot to make your posts more accessible.",
"Human-written alt-text is often more accurate, so consider writing one yourself when possible.",
"Altbot is entirely opt-in and respects privacy by asking for consent when generating alt-text for others' posts.",
"You can report any issues or suggest improvements on Altbot's GitHub page.",
"Remember to mention @Altbot in your image posts for automatic alt-text generation!",
"Alt-text helps make the web more accessible for everyone. Keep it descriptive!",
"Use clear and concise language in your alt-text for better accessibility.",
"Consider the context of the image when writing alt-text to provide relevant details.",
"Try to include important visual details in your alt-text without being overly verbose.",
"Alt-text can describe emotions or actions depicted in an image, not just objects.",
"Keep practicing writing alt-text to improve your skills over time.",
"Remember, every image is unique. Tailor your alt-text to fit the specific content.",
"Altbot can be hosted by anyone! Check out the GitHub repository for setup instructions.",
"It is highly encouraged to host your own instance of Altbot to ensure privacy and control over the bot's behavior!",
"If you're unsure about the generated alt-text, feel free to edit it to better fit the image.",
"Following @Altbot ensures your images are automatically checked for alt-text.",
"Altbot is a community-driven project. Star it on GitHub to help improve accessibility!",
"Altbot is designed to enhance accessibility on the Fediverse. Join the mission!",
"Altbot respects privacy by only processing images without existing alt-text.",
"Consider contributing to Altbot's development on GitHub to help improve accessibility.",
"Altbot's alt-text generation is a helpful tool, but human insight is invaluable.",
"If Altbot has helped you, consider giving back by dontating to the project or contributing to its development!",
"Altbot uses a Large Language Model (LLM) to generate alt-text, but it's always good to verify the output.",
"You can customize Altbot's behavior via the config file if you're hosting it yourself.",
"Remember that Altbot asks for consent before generating alt-text for images in others' posts.",
"Altbot is open-source, meaning you can modify and improve it to better suit your needs.",
"Alt-text is crucial for accessibility; use Altbot to ensure your posts are inclusive.",
"You can adjust Altbot's settings to better fit your preferences if you host it yourself.",
"Altbot's generated alt-text is a starting point; feel free to enhance it with personal touches.",
"Stay engaged with the Altbot community for updates and tips on improving accessibility.",
"Compete in the weekly leaderboard by writing alt-texts for your own posts without the use of altbot!",
"When you write your own alt-texts, you can provide more context and details than Altbot can generate.",
"When you write your own alt-texts, you help save electricity and reduce carbon emissions by not using AI models!",
"When you write your own alt-texts, you can provide a more personal touch to your posts.",
"When you write your own alt-texts, you can ensure that the alt-text is accurate and relevant to the image.",
"Altbot is great for generating alt-texts quickly, but human-written alt-texts are often more accurate and detailed.",
"Altbot is a great tool for generating alt-texts, but it's always good to review and edit the output for accuracy.",
]