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

Configuration overwrite for 'local_model_name' in 'config.py' #1

Open
twinsten opened this issue Sep 2, 2024 · 0 comments
Open

Configuration overwrite for 'local_model_name' in 'config.py' #1

twinsten opened this issue Sep 2, 2024 · 0 comments

Comments

@twinsten
Copy link

twinsten commented Sep 2, 2024

Description: The configuration for local_model_name gets overwritten in the .json-config, preventing the addition of a local model in the llm2ssh setup. I think this is caused by the missing initialization of local_model_name in the from_dict method of the Config class.

Steps to Reproduce:

  1. Install from pip
  2. Configure the local URI and set default_model to "local". Set a local_model_name.
  3. Observe that the local_model_name configuration gets overwritten.

Actual Behavior: The local_model_name configuration is overwritten, causing the local model setup to fail.

Environment:
OS: macOS
Python Version: 3.11.2
Package Version: llm2ssh 0.3.7
Local LLM: Ollama running Llama3.1

Proposed Solution:
modify the from_dict method of the Config class in config.py to include the local_model_name field. The updated method may look like this:

@classmethod
def from_dict(cls, d: dict) -> "Config":
    return cls(
      default_model = d.get('default_model', 'groq-llama3-70b'),
      openai_api_key = d.get('openai_api_key', ''),
      claude_api_key = d.get('claude_api_key', ''),
      groq_api_key = d.get('groq_api_key', ''),
      cerebras_api_key = d.get('cerebras_api_key', ''),
      local_uri = d.get('local_uri', 'http://localhost:5000/v1'),
      local_api_key = d.get('local_api_key', ''),
      local_model_name = d.get('local_model_name', ''),  # --> Add this line
      temperature = d.get('temperature', 0.2),
      i_like_to_live_dangerously = d.get('i_like_to_live_dangerously', False),
    )
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

1 participant