Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ollama support #313

Merged
merged 29 commits into from
Oct 22, 2024
Merged

Add ollama support #313

merged 29 commits into from
Oct 22, 2024

Conversation

keturiosakys
Copy link
Member

@keturiosakys keturiosakys commented Oct 9, 2024

A cursory test of the Llama 3.1 model shows that it has become quite capable of supporting some of our request generation use cases. This makes for a good case to add support for using the Fiberplane Studio with Ollama.

To test:

  • Set up ollama locally, make sure you have llama 3.1 (8B) running: ollama run llama3.1
  • Rebuild types (pnpm build:types from the root)
  • Go to settings, and set your model provider to ollama

api/src/lib/ai/ollama.ts Outdated Show resolved Hide resolved
api/src/lib/ai/ollama.ts Outdated Show resolved Hide resolved
api/src/lib/ai/ollama.ts Outdated Show resolved Hide resolved
api/src/lib/ai/ollama.ts Outdated Show resolved Hide resolved
* NOTE - I had to stop instructing the AI to create very long data in this prompt.
* It would end up repeating 9999999 ad infinitum and break JSON responses.
*/
export const LLAMA_3_8B_QA_PARAMETER_GENERATION_SYSTEM_PROMPT = cleanPrompt(`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE!!! I have not updated the "hostile" prompt at all yet, it may run into issues

@@ -302,6 +308,176 @@ Use the tool "make_request". Always respond in valid JSON.
***Don't make your responses too long, otherwise we cannot parse your JSON response.***
`);

export const LLAMA_3_8B_FRIENDLY_PARAMETER_GENERATION_SYSTEM_PROMPT =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this prompt has been modified from the OG system prompt we usually send to anthropic and openai

i found that reducing the scope of what we're trying to do worked better. so, we ONLY tell it to deal with json bodies, not worry about text + form data + etc

Copy link

pkg-pr-new bot commented Oct 21, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/fiberplane/fpx/@fiberplane/studio@313
pnpm add https://pkg.pr.new/fiberplane/fpx/@fiberplane/hono-otel@313

commit: 9dab0b4

@mies
Copy link
Contributor

mies commented Oct 21, 2024

we should show a nice message when you've picked a model in ollama that has not been pulled

@keturiosakys keturiosakys changed the title WIP: Add ollama support Add ollama support Oct 22, 2024
@keturiosakys keturiosakys marked this pull request as ready for review October 22, 2024 16:38
@keturiosakys keturiosakys merged commit a82be2f into main Oct 22, 2024
4 checks passed
@keturiosakys keturiosakys deleted the ollama branch October 22, 2024 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants