Hosting g4f server

Hi everyone, I am hosting my script on render and it works and returns json as such;

{
    "input": "write me a short python code."
}

{
    "data": {
        "messages": [
            {
                "content": "Sure! Here’s a short Python code that generates a list of the first 10 Fibonacci numbers:\n\n```python\ndef fibonacci(n):\n    fib_sequence = []\n    a, b = 0, 1\n    for _ in range(n):\n        fib_sequence.append(a)\n        a, b = b, a + b\n    return fib_sequence\n\n# Generate the first 10 Fibonacci numbers\nfib_numbers = fibonacci(10)\nprint(fib_numbers)\n```\n\nWhen you run this code, it will output:\n\n```\n[0, 1, 1, 2, 3, 5, 8, 13, 21, 34]\n```\n\nFeel free to modify the value of `n` in the `fibonacci` function call to generate more or fewer Fibonacci numbers!",
                "role": "assistant"
            }
        ]
    },
    "status": "success"
}

when it comes to adding the url into bolt.diy (running on cloudflare) I use OpenAILike but I am not getting any response. It must be something to the with json formating. Can somebody help me please?


Hi @lendan017,

I dont understand what your usecase is / what you are trying to do. Can you explain a bit more in detail please?

General: Bolt.diy is not optimized/designed for writing python code. The prompts are not made for it and also the webcontainer will not execute/show python code at all.

G4f is free chatgpt library, I want to configure api for my server. I picked the OpenAlLike in the bolt settings. Python code input was just to test it on postman.

Ok, dont know this tool and just checked it out.

For me even the curl in the docs from them is working. Did you verify it is before you tried to use it in bolt?

Well, if I could configure the server in the same way that openailike, I don’t see why it wouldn’t work. I need the correct endpoints, json format. Then, I can try and see if I get any response. I put my base url directly from render but I am not sure about the endpoint.

I dont see you answered my question :wink:

For me it makes no sense to investigate here more, when the default usecase which is described in their docs is not working.