Skip to content

Commit ceb1d76

Browse files
committed
ollama service exposed to host and tunnelled via tailnet to securely serve ollama inference to dev machine in tailnet (tailscale internal network)
1 parent 613ad4d commit ceb1d76

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Core config (both modes)
1+
ENV=dev # Set to 'prod' for production environment
22
OLLAMA_HOST=http://ollama:11434
33
AGENT_WORKSPACE=/workspace
44
OLLAMA_MODEL=llama3.2:1b

agent/app/agentic_loop.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
load_dotenv()
1414

15-
OLLAMA_HOST = "http://ollama:11434"
15+
OLLAMA_HOST = lambda: "http://100.88.9.73:11434" if os.getenv("ENV") == "dev" else "http://ollama:11434"
1616
OLLAMA_MODEL = os.getenv("OLLAMA_MODEL", "llama3.2:3b")
1717

1818

@@ -21,7 +21,7 @@ def ollama_generate(prompt: str, is_json_response: bool = True):
2121
payload = {
2222
"model": OLLAMA_MODEL,
2323
"prompt": prompt,
24-
"stream": True,
24+
"stream": False,
2525
}
2626

2727
if is_json_response:

docker-compose.prod.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
services:
22
ollama:
3-
ports: []
3+
ports:
4+
- "127.0.0.1:11434:11434"
45

56
agent:
67
image: ghcr.io/himmat12/local-code-agent:latest

0 commit comments

Comments
 (0)