Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ollama documentation needed for remote URL #274

Open
michela opened this issue Feb 19, 2025 · 2 comments
Open

Ollama documentation needed for remote URL #274

michela opened this issue Feb 19, 2025 · 2 comments

Comments

@michela
Copy link

michela commented Feb 19, 2025

OllamaLLM remote server configuration should be documented - and this package should provide a method for overriding the base_url in code and not rely on undocumented environment variable OLLAMA_HOST

e.g. a parameter like this for clarity

llm = OllamaLLM(
    base_url='http://<YOUR IP>:11434',   # PROPOSAL - NOT SUPPORTED ATM
    model_name=LLM_MODEL, 
    model_params={
        "max_tokens": 2000,
        "response_format": {"type": "json_object"},
    }
)

Atm the only way to get remote OLLAMA server connection is to set OLLAMA_HOST env variable and this is only apparent if you do the above and you get this helpful error / clue!

  base_url=_parse_host(host or os.getenv('OLLAMA_HOST')),
@stellasia
Copy link
Contributor

Hi @michela ,

The OllamaLLM class uses the ollama Python package and all parameters but the model_name and model_params will be passed to the ollama client. That means you should be able to use:

llm = OllamaLLM(
    host='http://<YOUR IP>:11434',
    model_name=LLM_MODEL, 
    model_params={
        "max_tokens": 2000,
        "response_format": {"type": "json_object"},
    }
)

We can work on making it clearer in the documentation.

@michela
Copy link
Author

michela commented Feb 19, 2025

Ah great! Thanks

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

No branches or pull requests

2 participants