Code Monkey home page Code Monkey logo

bunny-llm's Introduction

Bunny-LLM

a Deno LLM API Service

Usage

Set base_url to https://bunny-llm.deno.dev/v1/ or your own endpoint.

Set env variable BUNNY_API_TOKEN and specific vendor tokens.

Model format [vendor]:[model_name], for example openai:gpt-4-turbo

Example

from openai import OpenAI

client = OpenAI(
    base_url='https://bunny-llm.deno.dev/v1/',
    api_key='YOUR_BUNNY_API_TOKEN',
)
model_name = 'cloudflare:@cf/qwen/qwen1.5-0.5b-chat'

res = client.chat.completions.create(
    model=model_name,
    messages=[
        {'role': 'user', 'content': 'Who are you?'}
    ],
)
print(res.choices[0].message.content)

Free ChatGPT 3.5

vendor is free

api_key is EMPTY

model is gpt-3.5-turbo only

CloudFlare Workers AI

vendor is cf or cloudflare

model can refer to Supported Models

Set env variable CF_ACCOUNT_ID and CF_API_TOKEN or use the following algorithm.

// JavaScript
api_key = encodeURIComponent(JSON.stringify({
    'account': 'YOUR_CF_ACCOUNT_ID',
    'token': 'YOUR_CF_API_TOKEN',
}))
# python
import json
import urllib.parse

api_key=urllib.parse.quote(json.dumps({
    'account': 'YOUR_CF_ACCOUNT_ID',
    'token': 'YOUR_CF_API_TOKEN',
}))

DashScope

vendor is ds or dash_scope

model can refer to Supported Models

api_key can set by DASHSCOPE_API_KEY or pass it directly Get API KEY

Groq

vendor is groq

api_key can set by GROQ_API_KEY or pass it directly Get API KEY

model can refer to Supported Models

Deploy

Vercel

Deploy with Vercel

bunny-llm's People

Contributors

ivanlulyf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

nonpointer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.