Skip to content

Commit

Permalink
server/llm: first steps towards supporting ollama
Browse files Browse the repository at this point in the history
  • Loading branch information
haraldschilly committed Feb 22, 2024
1 parent db74cf7 commit fda426d
Show file tree
Hide file tree
Showing 11 changed files with 632 additions and 53 deletions.
4 changes: 4 additions & 0 deletions src/packages/frontend/components/language-model-icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { unreachable } from "@cocalc/util/misc";
import AIAvatar from "./ai-avatar";
import GoogleGeminiLogo from "./google-gemini-avatar";
import GooglePalmLogo from "./google-palm-avatar";
import OllamaAvatar from "./ollama-avatar";
import OpenAIAvatar from "./openai-avatar";

export function LanguageModelVendorAvatar(
Expand Down Expand Up @@ -40,6 +41,9 @@ export function LanguageModelVendorAvatar(
return fallback();
}
}
case "ollama":
return <OllamaAvatar size={size} style={style} />;

default:
unreachable(vendor);
return fallback();
Expand Down
33 changes: 33 additions & 0 deletions src/packages/frontend/components/ollama-avatar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { CSS } from "../app-framework";
import ollamaPng from "./ollama.png";

export default function OllamaAvatar({
size = 64,
style,
}: {
size: number;
style?: CSS;
}) {
// render the ollamaPng (a square png image with transparent background) with the given size and background color

return (
<div
style={{
width: size,
height: size,
display: "inline-block",
position: "relative",
}}
>
<img
src={ollamaPng}
style={{
width: size,
height: size,
backgroundColor: "transparent",
...style,
}}
/>
</div>
);
}
Binary file added src/packages/frontend/components/ollama.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit fda426d

Please sign in to comment.