ax-llm / ax

The unofficial DSPy framework. Build LLM powered Agents and "Agentic workflows" based on the Stanford DSP paper.
http://axllm.dev
Apache License 2.0
1.05k stars 69 forks source link

Error processing text: Error: Embed model not set when using ollama. #24

Closed remisharrock closed 3 months ago

remisharrock commented 3 months ago

Indeed in ollama i have only one model: 'llama3:latest' installed. Should I install an embedding model like explained here https://ollama.com/blog/embedding-models

But then how do I configure this model in here:

export type AxOllamaArgs = {
  model: string;
  url?: string;
  apiKey?: string;
  config?: Readonly<Omit<AxOllamaAIConfig, 'model'>>;
  options?: Readonly<AxAIServiceOptions>;
};

thanks for the help!

dosco commented 3 months ago

I will set two default models on ollama in the default config but you are free to change them as below

  model: 'nous-hermes2',
  embedModel: 'all-minilm'
const ai = axAI('ollama', { model: 'nous-hermes2' , embedModel: 'mxbai-embed-large' });