Welcome to Portkey Forum

e
endyb
Offline, last seen last week
Joined January 25, 2025
Another thing:
Sometimes when running the API I get this error
Plain Text
{"code":404,"message":"models/gemini-2.0-flash-lite-preview-02-05 is not found for API version v1beta, or is not supported for generateContent. Call ListModels to see the list of available models and their supported methods.","status":"NOT_FOUND"}}]

Is this error directly from Google?
5 comments
e
v
Hay guys, do you have any method to contruct a url using the trade_id returned by prompt completions?
We need an access point with the prompt and input snapshot for each iteation.
If not, at least a way to retrieve the information available through the trace_id.
1 comment
s
Hi guys, Is there any way for defining my primary model on UI (directly on PortKey web) and the secondary of fallback models in my code?
I am using prompt completion and fallback for LLM level.
3 comments
e
v
Hi Guys.
Is it possible to retrieve the Trace IA of a Log to be stored? Actually I would like to store the log's url on each iteration. (Prompt completion)
5 comments
C
e
Hello @Chanel
@sega is there a way to use our own fine-tuned model through portkey?
I mean a FT-GPT4o model.
6 comments
V
e
Hi everyone! 👋

I’m working on a use case where I’m using the portkey.prompts.completions.create method to integrate AI model calls. Here’s a snippet of my code:
Plain Text
portkey = Portkey(
    api_key= get_portkey_apikey(),
    virtual_key="openai-key-...",
    config='pc-cache-...'
)

ai_balancer_v2_response = portkey.prompts.completions.create(
    prompt_id="pp-balancer-...",
    variables={
        "user_query": f"{msg_input}",
        "system_prompt": {
            "type": "text",
            "text": balancer_prompt,
            "cache_control": {"type": "cacheable"}
        }
    },
    tools=tool_definitions,
    tool_choice="required",
    parallel_tool_calls=False,
    max_tokens=1024
)

The issue I’m encountering is related to the caching mechanism. It seems that the cache is invalidated whenever I change the user_query (dynamic input). However, I need the cache to remain valid for the system prompt (balancer_prompt), even when the user input changes.

In my use case, the system prompt is consistent across requests, and I want to benefit from caching for it, but the user_query will always be different and should not affect the caching.
3 comments
s
s