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
This is a sample that shows the rough structure of an actual Defang sample. This top paragraph should give a bit of context about the project and what it does. The rest of the README should be a guide on how to use the sample. #REMOVE_ME_AFTER_EDITING
5
+
This sample demonstrates how to deploy [Ollama](https://ollama.com/) with Defang, along with a Next.js frontend using the [AI SDK](https://www.npmjs.com/package/ai) for smooth streaming conversations. By default it runs a very small model (`llama3.2:1b`) which can perform well with just a CPU, but we've included lines that you can uncomment in the compose file to enable GPU support and run a larger model like `gemma:7b`. If you want to deploy to a GPU powered instance, you will need to use your own AWS account with [Defang BYOC](https://docs.defang.io/docs/concepts/defang-byoc).
6
6
7
7
## Prerequisites
8
8
@@ -15,18 +15,9 @@ This is a sample that shows the rough structure of an actual Defang sample. This
15
15
To run the application locally, you can use the following command:
16
16
17
17
```bash
18
-
# This might be `docker compose -f compose.dev.yaml up` depending on the project. #REMOVE_ME_AFTER_EDITING
19
-
docker compose up
18
+
docker compose -f compose.dev.yaml up
20
19
```
21
20
22
-
## Configuration
23
-
#REMOVE_ME_AFTER_EDITING - this section should be removed if there are no configuration values needed. The intro text can probably stay, but the list of configuration values should be updated/removed if there are none.
24
-
25
-
For this sample, you will need to provide the following [configuration](https://docs.defang.io/docs/concepts/configuration). Note that if you are using the 1-click deploy option, you can set these values as secrets in your GitHub repository and the action will automatically deploy them for you.
26
-
27
-
### `API_KEY` #REMOVE_ME_AFTER_EDITING
28
-
An explanation of what the env var (`API_KEY`) is, etc.
29
-
30
21
## Deployment
31
22
32
23
> [!NOTE]
@@ -36,6 +27,8 @@ An explanation of what the env var (`API_KEY`) is, etc.
36
27
37
28
Deploy your application to the defang playground by opening up your terminal and typing `defang up`.
38
29
30
+
**Keep in mind that the playground does not support GPU instances.**
31
+
39
32
### BYOC (AWS)
40
33
41
34
If you want to deploy to your own cloud account, you can use Defang BYOC:
@@ -45,10 +38,10 @@ If you want to deploy to your own cloud account, you can use Defang BYOC:
45
38
46
39
---
47
40
48
-
Title: Sample Title #REMOVE_ME_AFTER_EDITING
41
+
Title: Ollama
49
42
50
-
Short Description: A short sentence or two describing the sample. #REMOVE_ME_AFTER_EDITING
43
+
Short Description: Ollama is a tool that lets you easily run large language models.
51
44
52
-
Tags: Tags, That, Are, Not, Programming, Languages #REMOVE_ME_AFTER_EDITING
45
+
Tags: AI, LLM, ML, Llama, Mistral, Next.js, AI SDK,
53
46
54
-
Languages: Programming, Languages, Used #REMOVE_ME_AFTER_EDITING
0 commit comments