Skip to content
This repository was archived by the owner on Feb 26, 2026. It is now read-only.
This repository was archived by the owner on Feb 26, 2026. It is now read-only.

Add support for openrouter  #33

@Wang-Yong2018

Description

@Wang-Yong2018

I noticed that the current pgai is only support chatgpt. But there are gemini, claude and llama and even more large language model existed. which provide same level service to GPT4 and cost efficient.

Is is possible to provide openrouter service as well?
Here is the document link, https://openrouter.ai/docs/quick-start
From the quick-start note, we can find it can use openai python library and compatible with openai chat.completion. The main changes will be
== connection

  1. support base_url parameter , by set it to openrouter address
  2. Add another api_keys
    By support base_url and additonal api_keys, the pgai will support connection to openrouter even ollama model
    ==model name
    use the model name from openrouter return api list
    I think let's all.

I will try to do it in my local computer first.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions