Bridge by Wekoya / Guides / Use LlamaIndex with Bridge

Use LlamaIndex with Bridge

In short: Install llama-index-llms-openai-like and create an OpenAILike with Bridge's API base, your key and is_chat_model=True. Set is_function_calling_model=True for tools and context_window to the model's real context. Every Bridge model then works in LlamaIndex, billed in naira.

Updated

pip install llama-index-llms-openai-like
import os
from llama_index.llms.openai_like import OpenAILike

llm = OpenAILike(
    model="gemini-3.5-flash-lite",
    api_base="https://wekoya-api.wekoya.tech/v1",
    api_key=os.environ["WEKOYA_API_KEY"],
    is_chat_model=True,
    is_function_calling_model=True,
    context_window=1048576,  # this model's context, from its page
)
print(llm.complete("Hello"))

Create a free account

Common questions

Why do I get 404 errors from LlamaIndex?

Usually is_chat_model is missing, so LlamaIndex calls /v1/completions. Set is_chat_model=True.

Read next