You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-3Lines changed: 10 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,9 @@
6
6
7
7
## Features :sparkles:
8
8
9
-
YouTubeGPT lets you **summarize and chat (Q&A)** with YouTube videos. Its features include:
9
+
YouTubeGPT is a web app that can be run fully locally and lets you **summarize and chat (Q&A)** with YouTube videos. You can either use OpenAI's API or a (local) Ollama instance.
10
+
11
+
YouTubeGPT's features include:
10
12
11
13
### :writing_hand: Provide a custom prompt for summaries [**VIEW DEMO**](https://youtu.be/rJqx3qvebws)
12
14
@@ -21,8 +23,9 @@ YouTubeGPT lets you **summarize and chat (Q&A)** with YouTube videos. Its featur
21
23
- the summaries and answers can be saved to a library accessible at a separate page!
22
24
- additionally, summaries and answers can be exported/downloaded as Markdown files!
23
25
24
-
### :robot: Choose from different OpenAI models
26
+
### :robot: Choose provider and models
25
27
28
+
- choose between OpenAI's API or a (local) Ollama instance
26
29
- currently available: ChatGPT 4-5 (incl. nano & mini) and *continuously updated* with new models
27
30
- by choosing a different model, you can summarize even longer videos and get better responses
28
31
@@ -36,7 +39,11 @@ YouTubeGPT lets you **summarize and chat (Q&A)** with YouTube videos. Its featur
36
39
37
40
## Installation & usage
38
41
39
-
No matter how you choose to run the app, you will first need to get an OpenAI API-Key. This is very straightforward and free. Have a look at [their instructions](https://platform.openai.com/docs/quickstart/account-setup) to get started.
42
+
If you want to use OpenAI's API, you will first need to get an OpenAI API-Key. This is very straightforward and free. Have a look at [their instructions](https://platform.openai.com/docs/quickstart/account-setup) to get started.
43
+
44
+
If you want to use Ollama, you need to have an Ollama server running locally or remotely. You can download Ollama for macOS, Linux, or Windows [on their website](https://ollama.com/download). Make sure the server is reachable either on the default port `11434` or set the `OLLAMA_HOST` environment variable to point to your Ollama server. Also, you need to **pull the models** you want to use.
45
+
46
+
> **Note**: Ollama limits the context window to 4k tokens by default. I strongly recommend to adjust it to at least 16k tokens. This can be done in the Ollama app settings.
message=f"Your transcript exceeds the context window of the chosen model ({llm.model_name}), which is {CONTEXT_WINDOWS[llm.model_name]['total']} tokens. "
90
+
message=f"Your transcript exceeds the context window of the chosen model ({llm.name}), which is {max_context_length} tokens. "
84
91
"Consider the following options:\n"
85
-
"1. Choose another model with larger context window (such as gpt-4o).\n"
92
+
"1. Choose another model with larger context window.\n"
86
93
"2. Use the 'Chat' feature to ask specific questions about the video. There you won't be limited by the number of tokens.\n\n"
87
-
"You can get more information on context windows for different models in the [official OpenAI documentation about models](https://platform.openai.com/docs/models).",
88
-
model_name=llm.model_name,
94
+
"You can get more information on context windows for different OpenAI models in the [official documentation](https://platform.openai.com/docs/models).",
95
+
model_name=llm.name,
89
96
)
90
97
91
98
messages= [
92
99
SystemMessage(content=SYSTEM_PROMPT),
93
100
HumanMessage(content=user_prompt),
94
101
]
95
102
103
+
logging.info(
104
+
"Generating summary using model: %s. Total tokens: %d", llm.name, total_tokens
Copy file name to clipboardExpand all lines: modules/ui.py
+42-4Lines changed: 42 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -5,15 +5,19 @@
5
5
frommodules.helpersimport (
6
6
get_available_models,
7
7
get_default_config_value,
8
+
get_ollama_models,
8
9
is_api_key_set,
9
10
is_api_key_valid,
11
+
is_ollama_available,
10
12
)
11
13
12
14
GENERAL_ERROR_MESSAGE="An unexpected error occurred. If you are a developer and run the app locally, you can view the logs to see details about the error."
13
15
14
16
15
17
defdisplay_api_key_warning():
16
18
"""Checks whether an API key is provided and displays warning if not."""
"OpenAI generally recommends altering temperature or top_p but not both. See their [API reference](https://platform.openai.com/docs/api-reference/chat/create#chat-create-temperature)"
""":warning: Be aware of the higher costs and latencies when using more advanced (reasoning) models (like gpt-5). You can see details (incl. costs) about the models and compare them [here](https://platform.openai.com/docs/models/compare)."""
0 commit comments