Skip to content

fix(ollama): set OLLAMA_HOST from env variable#316

Merged
waleedlatif1 merged 1 commit intosimstudioai:mainfrom
gabelazo:fix/ollama-host-env
Apr 30, 2025
Merged

fix(ollama): set OLLAMA_HOST from env variable#316
waleedlatif1 merged 1 commit intosimstudioai:mainfrom
gabelazo:fix/ollama-host-env

Conversation

@gabelazo
Copy link
Copy Markdown
Contributor

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.

Fix for using local ollama instance running on host via host.docker.internal mapping. Currently hardcoded to localhost which results in ECONNREFUSED.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Security enhancement
  • Performance improvement
  • Code refactoring (no functional changes)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

Tested using docker compose with host mapping:

    extra_hosts:
      - "host.docker.internal:host-gateway"
    environment:
      - OLLAMA_HOST=http://host.docker.internal:11434

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • All tests pass locally and in CI (npm test)
  • [x ] My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • I have updated version numbers as needed (if needed)
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Security Considerations:

  • My changes do not introduce any new security vulnerabilities
  • I have considered the security implications of my changes

Additional Information:

Any additional information, configuration or data that might be necessary to reproduce the issue or use the feature.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 30, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 30, 2025 9:15pm

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 30, 2025

@gabelazo is attempting to deploy a commit to the Sim Studio Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mrge found 1 issue across 1 file. View it in mrge.io


const logger = createLogger('Ollama Provider')
const OLLAMA_HOST = 'http://localhost:11434'
const OLLAMA_HOST = process.env.OLLAMA_HOST || 'http://localhost:11434'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing protocol enforcement for OLLAMA_HOST which could lead to connection issues

@waleedlatif1 waleedlatif1 merged commit 62fc5b8 into simstudioai:main Apr 30, 2025
4 of 5 checks passed
RadoBoiii pushed a commit to RadoBoiii/sim-fork that referenced this pull request May 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants