eca icon indicating copy to clipboard operation
eca copied to clipboard

[Question] How do I configure Azure openAI with litellm provider

Open ChetanKoneru opened this issue 1 year ago • 11 comments

curl -X POST "https://myopenai.openai.azure.com/openai/responses?api-version=2025-04-01-preview \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer $AZURE_API_KEY" \
    -d '{
        "messages": [
            {
                "role": "user",
                "content": "I am going to Paris, what should I see?"
            }
        ],
        "max_completion_tokens": 16384,
        "model": "gpt-5"
    }'

https://eca.dev/models/#litellm

Looks like openai-responses only support this endpoint - OpenAI's new responses API endpoint (/v1/responses).

but I have only have openai/responses nov1 in the endpoint.

Is it possible to configure Azure OpenAI?

ChetanKoneru avatar Aug 27 '25 17:08 ChetanKoneru

Hey @CsBigDataHub never tried with azure, let's find out and add a example in https://eca.dev/models later.

Try this:

~/.config/eca/config.json

{
    "providers": {
        "your-company": {
            "api": "openai-responses",
            "url": "https://myopenai.openai.azure.com",
            "key": "<your-key>",
            "completionUrlRelativePath": "/openai/responses?api-version=2025-04-01-preview",
            "models": {"gpt-5": {}}
        }
    }
}

I don't have azure so it's hard to test, but if we find out we can add examples for other people

ericdallo avatar Aug 27 '25 17:08 ericdallo

Thanks, that works.

Quick question, the eca chat buffer, can it be a org-mode buffer?, if not that is fine but it can be a feature for the backlog.

ChetanKoneru avatar Aug 27 '25 18:08 ChetanKoneru

I apologize, this is move to done in your backlog as soon as I closed the issue.

ChetanKoneru avatar Aug 27 '25 18:08 ChetanKoneru

Thanks, that works.

Cool, I will add a example for azure.

@CsBigDataHub currently not as eca server communicates asking in markdown mode which is way more famous and trained in AI than org-mode unfortunately

ericdallo avatar Aug 27 '25 18:08 ericdallo

No worries, Markdown works too.

For what ever reason GitHub copilot give me response in Markdown but GPT-5 from above config gives me response in plain text , is there some setting I need to enable for the provider?

ChetanKoneru avatar Aug 27 '25 18:08 ChetanKoneru

not really, I use gpt5 daily and most of the time it outputs as markdown, but has some times it just outputs simple text indeed

ericdallo avatar Aug 27 '25 18:08 ericdallo

Just added the docs here, thanks!

ericdallo avatar Aug 27 '25 19:08 ericdallo

Yes you are correct, it did respond in Markdown when I specifically asked it to do so.

Anyway, enjoying the package so far. I will try to configure it further to fit my needs and provide feedback.

Also where can I tweak the PLAN and AGENT system prompts? or if I have new prompts like TEST, how do I create a new behavior to map it to.

Thank you again.

ChetanKoneru avatar Aug 27 '25 19:08 ChetanKoneru

awesome!

@zikajk is almost done with a PR for that, you can follow #75, we intend to add support for customize behaviors at #79

ericdallo avatar Aug 27 '25 19:08 ericdallo

cool, also a quick suggestion, Maybe configuration should allow to configure Models for Behaviors. Like - Using Claude model for PLAN and GPT model for AGENT.

Maybe this is already in your radar.

ChetanKoneru avatar Aug 27 '25 19:08 ChetanKoneru

Yep, that's our plan! Our idea is to make it full configurable like models are today, so you can configure behaviors and models with defaults one from eca, thanks for the feedback!

ericdallo avatar Aug 27 '25 20:08 ericdallo