Skip to content

Commit

Permalink
stash work
Browse files Browse the repository at this point in the history
  • Loading branch information
sxlijin committed Jul 25, 2024
1 parent 20d1a8f commit 2f890f8
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 10 deletions.
2 changes: 2 additions & 0 deletions docs/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ navigation:
contents:
- page: Overview
path: docs/snippets/clients/overview.mdx
- page: Accordion
path: docs/snippets/clients/accordion.mdx
- section: providers
contents:
- page: anthropic
Expand Down
46 changes: 46 additions & 0 deletions docs/docs/snippets/clients/accordion.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
slug: docs/snippets/clients/accordion
---

This is a placeholder page - do not link to it, do not use it. Am using it to try out AccordionGroup for our providers.

## Providers

<AccordionGroup>
<Accordion title="Anthropic">
<Markdown src="providers/anthropic.mdx" />
</Accordion>
<Accordion title="aws-bedrock">
<Markdown src="providers/aws-bedrock.mdx" />
</Accordion>
<Accordion title="azure-openai">
<Markdown src="providers/azure.mdx" />
</Accordion>
<Accordion title="google-ai">
<Markdown src="providers/gemini.mdx" />
</Accordion>
<Accordion title="groq">
<Markdown src="providers/groq.mdx" />
</Accordion>
<Accordion title="huggingface">
<Markdown src="providers/huggingface.mdx" />
</Accordion>
<Accordion title="ollama">
<Markdown src="providers/ollama.mdx" />
</Accordion>
<Accordion title="openai">
<Markdown src="providers/openai.mdx" />
</Accordion>
<Accordion title="openrouter">
<Markdown src="providers/openrouter.mdx" />
</Accordion>
<Accordion title="together-ai">
<Markdown src="providers/together.mdx" />
</Accordion>
<Accordion title="vertex-ai">
<Markdown src="providers/vertex.mdx" />
</Accordion>
<Accordion title="vllm">
<Markdown src="providers/vllm.mdx" />
</Accordion>
</AccordionGroup>
8 changes: 4 additions & 4 deletions docs/docs/snippets/clients/overview.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
slug: docs/snippets/clients
slug: docs/snippets/clients/overview
---

Clients are used to configure how LLMs are called, like so:
Expand All @@ -13,13 +13,13 @@ function MakeHaiku(topic: string) -> string {
}
```

This is `provider/model` shorthand for:
This is `<provider>/<model>` shorthand for:

```rust BAML
client<llm> MyClient {
provider openai
provider "openai"
options {
model gpt-4o
model "gpt-4o"
// api_key defaults to env.OPENAI_API_KEY
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/snippets/clients/providers/huggingface.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ See https://huggingface.co/docs/inference-endpoints/index for more information o

```baml BAML
client<llm> MyClient {
provider openai
provider openai-generic
options {
base_url "https://api-inference.huggingface.co/v1"
api_key env.HUGGINGFACE_API_KEY
Expand Down
1 change: 0 additions & 1 deletion docs/docs/snippets/clients/providers/ollama.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ title: ollama
slug: docs/snippets/clients/providers/ollama
---


For `ollama`, we provide a client that can be used to interact with [ollama](https://ollama.com/) `/chat/completions` endpoint.

<Info>What is ollama? Ollama is an easy way to run LLMs locally!</Info>
Expand Down
9 changes: 6 additions & 3 deletions docs/docs/snippets/clients/providers/together.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@

---
title: together
slug: docs/snippets/clients/providers/together
---

https://www.together.ai/ - The fastest cloud platform for building and running generative AI.

Together AI supports the OpenAI client, allowing you to use the [openai](/docs/snippets/clients/providers/openai) provider with an overriden `base_url`
Together AI supports the OpenAI client, allowing you to use the [openai-generic](/docs/snippets/clients/providers/openai-generic) provider with an overriden `base_url`

See https://docs.together.ai/docs/openai-api-compatibility for more information.

```baml BAML
client<llm> MyClient {
provider openai
provider openai-generi
options {
base_url "https://api.together.ai/v1"
api_key env.TOGETHER_API_KEY
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/snippets/clients/providers/vllm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ See https://docs.vllm.ai/en/latest/serving/openai_compatible_server.html for mor

```baml BAML
client<llm> MyClient {
provider openai
provider openai-generic
options {
base_url "http://localhost:8000/v1"
api_key "token-abc123"
Expand Down

0 comments on commit 2f890f8

Please sign in to comment.