Skip to content

Conversation

kazuhitoyokoi
Copy link

The OpenAI module already has functionality to access other APIs. This pull request allows the base_url setting to specify other APIs. For example, by supporting this setting, we can access Google Gemini API or Ollama API using the following code.

Google Gemini

import gradio as gr
import openai_gradio

gr.load(
    name='gemini-2.0-flash-exp',
    token='<Gemini API Key>',
    base_url="https://generativelanguage.googleapis.com/v1beta/",
    src=openai_gradio.registry,
).launch()

Ollama

import gradio as gr
import openai_gradio

gr.load(
    name='llama3.2',
    token='ollama',
    base_url="http://localhost:11434/v1",
    src=openai_gradio.registry,
).launch()

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.

1 participant