From 3390494f65832e850ec5f0c218e8504e1bf92da8 Mon Sep 17 00:00:00 2001 From: Daniel Lenton Date: Tue, 30 Jul 2024 22:03:47 +0100 Subject: [PATCH] improvements to the Universal API page. --- docs/concepts/unify_api.rst | 36 +++++++++++++++++------------------- docs/home/home.rst | 4 ++-- docs/partial_conf.py | 3 --- docs/prebuild.sh | 0 4 files changed, 19 insertions(+), 24 deletions(-) mode change 100644 => 100755 docs/prebuild.sh diff --git a/docs/concepts/unify_api.rst b/docs/concepts/unify_api.rst index 2be7944..e88fff6 100644 --- a/docs/concepts/unify_api.rst +++ b/docs/concepts/unify_api.rst @@ -1,38 +1,36 @@ Universal API ============== -There’s a sea of models and providers, with new LLMs coming out all the time. -Each provider has its own API keys, account balance, and subtle nuances in how the models are queried. +There’s an ever expanding ocean of models and providers, with new LLMs coming out all the time 🌊 +Each provider requires a unique API key, unique payment processing system, and unique format for querying the API. +When testing out different models and providers, it can quickly become very cumbersome to manage all of these nuances 🫠 -The Unify Universal API provides: +Our Universal API provides: -- A single, common interface for all models and providers -- One account, with one balance and one API key +- A single, common interface for all models and providers 🟒 +- One account, with one balance and one API key πŸ”‘ -You can interact with the API through a HTTP request from any programming language, through our own Unify Python package, or through the OpenAI Python package. - -Authentication --------------- -You need an API key to query the API. `Sign up for an account `_, and get your API key from the `console `_. +To get your universal API key, simply `sign up`_! Querying the API ---------------- -There are three ways to query the API: -- HTTP request -- Unify Python package -- OpenAI Python package +You can interact with the API via: +- `HTTP Requests`_ from any programming language +- Our own `Unify Python Package`_ +- The `OpenAI Python Package`_ +- The `OpenAI NodeJS Package`_ -HTTP Request -^^^^^^^^^^^^ -Run the following command in a terminal (replacing :code:`$UNIFY_API_KEY` with your own). +HTTP Requests +^^^^^^^^^^^^^ +Run the following command in a terminal (replacing :code:`$UNIFY_KEY` with your own). .. code-block:: curl -X 'POST' \ 'https://api.unify.ai/v0/chat/completions' \ - -H 'Authorization: Bearer $UNIFY_API_KEY' \ + -H 'Authorization: Bearer $UNIFY_KEY' \ -H 'Content-Type: application/json' \ -d '{ "model": "llama-3-8b-chat@fireworks-ai", @@ -103,7 +101,7 @@ Sample inference .. code-block:: python from unify import Unify - client = Unify("llama-3-8b-chat@fireworks-ai", api_key="$UNIFY_API_KEY") + client = Unify("llama-3-8b-chat@fireworks-ai", api_key="$UNIFY_KEY") response = client.generate("Say hi.") OpenAI Python Package diff --git a/docs/home/home.rst b/docs/home/home.rst index c41b1b2..52786a2 100644 --- a/docs/home/home.rst +++ b/docs/home/home.rst @@ -4,9 +4,9 @@ Welcome to Unify! We're on a mission to unify and simplify the LLM landscape. Unify lets you: * **πŸ”‘ Use any LLM from any Provider**: With a single interface, you can use all LLMs from all providers by simply changing one string. No need to manage several API keys or handle different input-output formats. Unify handles all of that for you! - +| * **πŸ“Š Improve LLM Performance**: Add your own custom tests and evals, and benchmark your own prompts on all models and providers. Comparing quality, cost and speed, and iterate on your system prompt until all test cases pass, and you can deploy your app! - +| * **πŸ”€ Route to the Best LLM**: Improve quality, cost and speed by routing to the perfect model and provider for each individual prompt. Quick Start diff --git a/docs/partial_conf.py b/docs/partial_conf.py index b5f7364..42745e4 100644 --- a/docs/partial_conf.py +++ b/docs/partial_conf.py @@ -1,5 +1,4 @@ from typing import List -import os # Retrieve html_theme_options from docs/conf.py from docs.conf import html_theme_options, extensions, html_static_path @@ -13,8 +12,6 @@ # Add any paths that contain custom static files (such as style sheets) here, relative to this directory. html_static_path.append('./demos/demos/videos/') - - project = "Unify" html_title = "Unify Documentation" diff --git a/docs/prebuild.sh b/docs/prebuild.sh old mode 100644 new mode 100755