|
| 1 | + |
| 2 | +## Install Ollama on Linux |
| 3 | + |
| 4 | +``` |
| 5 | +docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama |
| 6 | +``` |
| 7 | + |
| 8 | +``` |
| 9 | +Unable to find image 'ollama/ollama:latest' locally |
| 10 | +latest: Pulling from ollama/ollama |
| 11 | +6414378b6477: Pull complete |
| 12 | +9423a26b200c: Pull complete |
| 13 | +629da9618c4f: Pull complete |
| 14 | +00b71e3f044c: Pull complete |
| 15 | +Digest: sha256:18bfb1d605604fd53dcad20d0556df4c781e560ebebcd923454d627c994a0e37 |
| 16 | +Status: Downloaded newer image for ollama/ollama:latest |
| 17 | +2352d454e7117a79459cd7d1413e686680a80927494ff6dbd70faebd3dcfabb0 |
| 18 | +``` |
| 19 | + |
| 20 | +## Pull Llama 3.2:1b Model |
| 21 | + |
| 22 | +``` |
| 23 | +curl http://localhost:11434/api/pull -d '{ |
| 24 | + "model": "llama3.2:1b" |
| 25 | +}' |
| 26 | +``` |
| 27 | + |
| 28 | +``` |
| 29 | +docker exec -it ollama ollama ls |
| 30 | +``` |
| 31 | + |
| 32 | +## Test if the model is serving |
| 33 | + |
| 34 | +``` |
| 35 | +curl http://localhost:11434/api/chat -d '{ |
| 36 | + "model": "llama3.2:1b", |
| 37 | + "messages": [ |
| 38 | + { |
| 39 | + "role": "user", |
| 40 | + "content": "Where is Paris" |
| 41 | + } |
| 42 | + ], |
| 43 | + "stream": false |
| 44 | +}' |
| 45 | +``` |
| 46 | + |
| 47 | +``` |
| 48 | +docker exec -it ollama ollama ps |
| 49 | +NAME ID SIZE PROCESSOR UNTIL |
| 50 | +llama3.2:1b baf6a787fdff 2.2 GB 100% CPU 4 minutes from now |
| 51 | +``` |
| 52 | + |
| 53 | + |
| 54 | +## Clone the AI Application |
| 55 | + |
| 56 | +Fork the Github Repo - https://github.com/db-agent/db-agent |
| 57 | + |
| 58 | +``` |
| 59 | +git clone https://github.com/db-agent/db-agent.git |
| 60 | +
|
| 61 | +``` |
| 62 | + |
| 63 | +## Build and deploy the App |
| 64 | + |
| 65 | +``` |
| 66 | +cd db-agent |
| 67 | +docker compose -f docker-compose.local.yml build |
| 68 | +docker compose -f docker-compose.local.yml up -d |
| 69 | +# Check logs |
| 70 | +docker compose -f docker-compose.local.yml logs -f |
| 71 | +
|
| 72 | +
|
| 73 | +``` |
| 74 | + |
0 commit comments