sigoden / aichat

All-in-one LLM CLI tool featuring Shell Assistant, Chat-REPL, RAG, AI tools & agents, with access to OpenAI, Claude, Gemini, Ollama, Groq, and more.
Apache License 2.0
4.52k stars 305 forks source link

wrong Vertex AI model name detected? #364

Closed engie-b2c-perf closed 8 months ago

engie-b2c-perf commented 8 months ago

Describe the bug

VertexAI client works but seems to get the wrong model names

To Reproduce

config.yaml:

model: vertexai:gemini-1.0-pro-vision  # default model
clients:
  - type: vertexai 
    api_base: https://{REGION}-aiplatform.googleapis.com/v1/projects/{PROJECT_ID}/locations/{REGION}/publishers/google/models
  - type: ollama
    api_base: http://localhost:11434
    models:
    - name: llama2
      max_input_tokens: null

Aichat seems to get the right model:

$ aichat --info
model               vertexai:gemini-1.0-pro-vision  ## name OK
temperature         -
dry_run             false
save                true
highlight           true
light_theme         false
wrap                no
wrap_code           false
auto_copy           false
keybindings         emacs
prelude             -
compress_threshold  2000
config_file         C:\Users\vctcb\AppData\Roaming\aichat\config.yaml
roles_file          C:\Users\vctcb\AppData\Roaming\aichat\roles.yaml
messages_file       C:\Users\vctcb\AppData\Roaming\aichat\messages.md
sessions_dir        C:\Users\vctcb\AppData\Roaming\aichat\sessions

but name seems wrong when you list models:

$ aichat --list-models
vertexai:gemini-1.0-pro
vertexai:gemini.1.0-pro-vision  ##  name KO: 'gemini.1.0' instead of 'gemini-1.0'
vertexai:gemini-1.0-ultra
vertexai:gemini.1.0-ultra-vision
vertexai:gemini-1.5-pro
ollama:llama2

and it seems to fail to load the right model because of this wrong name

$ aichat --file cat.jpg -- what is on the image?
Failed to get answer
Caused by:
    NOT_FOUND: Publisher Model `projects/dgp-sat-analysis-cb29cf/locations/europe-west1/publishers/google/models/gemini.1.0-pro-vision` not found.

Still, it works with simple text:

$ aichat
Welcome to aichat 0.14.0
Type ".help" for more information.
> test
Sure, here are some examples of tests...

Environment (please complete the following information):

VinceCabs commented 8 months ago

thanks @sigoden Interested by the binary or the scoop update to test the fix.