When provider_model is not provided, ChatAuto should look for known environment variables to select a default provider

Open
#266 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
ai

Research direction

Locate ChatAuto's handling of the provider_model fallback and its environment-variable lookup. Review how supported providers expose their known variables, then add coverage showing that a detected provider is selected and that no match still falls back to openai.

Written by the indexing model from the issue text.

Description

When provider_model is not specified and CHATLAS_CHAT_PROVIDER_MODEL is not set in the environment, ChatAuto always falls back to a default openai value.

I propose it would make more sense to check the environment for "known" variables and try to guess a better fallback: e.g. if OPENAI_API_KEY is defined, default to openai provider; if GOOGLE_API_KEY is defined, default to google provider, etc. If no known variable is detected, fallback to openai.

This would make it easier for an application that uses chatlas (to provide generic chat access, not tied to a particular provider) to be configured automatically based on the environment, w/out requiring an explicit configuration mechanism within the application (and without having to implement its own detection logic, that would later have to be kept in sync with chatlas' supported models).

Dominant language
Python
Stars
179
Forks
32
Avg merge
1d 3h
Merged PRs (30d)
10

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from posit-dev/chatlas

All issues in posit-dev/chatlas

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.