Skip to content

Demo/llamastack budget#6

Merged
Hadar301 merged 9 commits intomainfrom
demo/llamastack-budget
Jan 13, 2026
Merged

Demo/llamastack budget#6
Hadar301 merged 9 commits intomainfrom
demo/llamastack-budget

Conversation

@Hadar301
Copy link
Contributor

@Hadar301 Hadar301 commented Jan 11, 2026

fix:

  1. Add Llamastack client library to ui req.
  2. Add route clause to Llamastack.
  3. fix: ui image tag.

  1. added budget management with Llamastack.
  2. added documentation regarding our findings for using:

Client with LiteLLM as backend

 lite_client = LlamaStackClient(
    base_url=LITELLM_URL,  # Your LiteLLM URL
    api_key="...",
)

VS.
Client with Llamastack server configured with LiteLLM as backend

llama_stack_client = LlamaStackClient(base_url=LLAMASTACK_URL)

Update: use the X-LlamaStack-Provider-Data header for dynamic authentication, now the demo is working with llamastack server

llamastack_client = LlamaStackClient(
        base_url=LLAMASTACK_URL,  # Connect to LlamaStack server
        provider_data={
            "vllm_api_token": budgeted_api_key  # Pass budgeted key via X-LlamaStack-Provider-Data
        }
    )

1. add llamastackclient library to ui req
2. add route clause to llamastack
2. added documentaion regarding our findings for using:

# Client with LiteLLM as backend
 lite_client = LlamaStackClient(
    base_url=LITELLM_URL,  # Your LiteLLM URL
    api_key="...",
)
VS.

# Client with Llamastack server configured with LiteLLM as backend
llama_stack_client = LlamaStackClient(base_url=LLAMASTACK_URL)
@Hadar301 Hadar301 requested a review from johnson2500 January 11, 2026 11:50
@Hadar301 Hadar301 marked this pull request as draft January 12, 2026 13:48

def create_budget_key(base_url: str, master_key: str, max_budget: float) -> dict:
"""Create a virtual key with a specified budget limit."""
url = f"{base_url}/key/generate"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh I see it now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll see if we can use the litellm python library for this instead of using requests

@Hadar301 Hadar301 marked this pull request as ready for review January 13, 2026 08:39
* Add redis deployment

* update budgest test (can't use the same message since we use cache)
@Hadar301 Hadar301 marked this pull request as draft January 13, 2026 08:57
@Hadar301 Hadar301 marked this pull request as ready for review January 13, 2026 09:11
@Hadar301 Hadar301 requested a review from johnson2500 January 13, 2026 09:11
Copy link
Contributor

@johnson2500 johnson2500 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. This looks very nice, and well documented. Thanks. I think later we can look at mine which can help with the API Keys.

@Hadar301 Hadar301 merged commit 683bed0 into main Jan 13, 2026
1 check passed
@Hadar301 Hadar301 deleted the demo/llamastack-budget branch January 14, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments