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-likeimport 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"))is_chat_model=Trueis required: without it LlamaIndex calls the old completions endpoint, which Bridge does not have.context_windowdefaults to 3,900 tokens. Set it to the model's context from its page on the models page.- For embeddings, Bridge serves
gemini-embedding-2on OpenAI's embeddings route. See embeddings.
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.