Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ LearnPath talks to any OpenAI-compatible `/chat/completions` endpoint. Built-in
| OpenAI | `openai` | `gpt-4o-mini` | Bearer | `OPENAI_API_KEY` |
| OpenRouter | `openrouter` | `openai/gpt-4o-mini` | Bearer | `OPENROUTER_API_KEY` |
| Ollama (local) | `ollama` | `llama3.1` | Bearer | `OLLAMA_BASE_URL` |
| Groq | `groq` | `llama-3.3-70b-versatile` | Bearer | `GROQ_API_KEY` |
| DeepSeek | `deepseek` | `deepseek-chat` | Bearer | `DEEPSEEK_API_KEY` |
| Together | `together` | `meta-llama/Llama-3.3-70B-Instruct-Turbo` | Bearer | `TOGETHER_API_KEY` |
| Mistral | `mistral` | `mistral-small-latest` | Bearer | `MISTRAL_API_KEY` |
| Xiaomi MiMo | `mimo` | `mimo-v2.5-pro` | api-key | `MIMO_API_KEY` |

Set `LLM_PROVIDER` + the matching key (or just `LLM_API_KEY`). Override `LLM_BASE_URL` / `LLM_MODEL` for any other compatible endpoint. The right auth header (bearer vs api-key) is chosen automatically. Quiz answers and chat responses surface a model's `reasoning_content` when available, but it isn't required.
Expand Down
28 changes: 28 additions & 0 deletions src/lib/mimo-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,34 @@ export const PROVIDER_PRESETS: Record<string, ProviderPreset> = {
envKey: "OLLAMA_API_KEY",
envBase: "OLLAMA_BASE_URL",
},
groq: {
baseUrl: "https://api.groq.com/openai/v1",
authStyle: "bearer",
model: "llama-3.3-70b-versatile",
envKey: "GROQ_API_KEY",
envBase: "GROQ_BASE_URL",
},
deepseek: {
baseUrl: "https://api.deepseek.com/v1",
authStyle: "bearer",
model: "deepseek-chat",
envKey: "DEEPSEEK_API_KEY",
envBase: "DEEPSEEK_BASE_URL",
},
together: {
baseUrl: "https://api.together.xyz/v1",
authStyle: "bearer",
model: "meta-llama/Llama-3.3-70B-Instruct-Turbo",
envKey: "TOGETHER_API_KEY",
envBase: "TOGETHER_BASE_URL",
},
mistral: {
baseUrl: "https://api.mistral.ai/v1",
authStyle: "bearer",
model: "mistral-small-latest",
envKey: "MISTRAL_API_KEY",
envBase: "MISTRAL_BASE_URL",
},
};

export const DEFAULT_PROVIDER = "mimo";
Expand Down
24 changes: 23 additions & 1 deletion tests/lib/multi-backend.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,36 @@ const KEY_EXPLICIT = ["k", "explicit"].join("-");

describe("Provider presets", () => {
it("includes the known providers", () => {
for (const p of ["mimo", "openai", "openrouter", "ollama"]) {
for (const p of ["mimo", "openai", "openrouter", "ollama", "groq", "deepseek", "together", "mistral"]) {
expect(PROVIDER_PRESETS[p]).toBeDefined();
}
});

it("defaults to mimo", () => {
expect(DEFAULT_PROVIDER).toBe("mimo");
});

it("groq preset is correct", () => {
expect(PROVIDER_PRESETS["groq"].baseUrl).toContain("api.groq.com");
expect(PROVIDER_PRESETS["groq"].authStyle).toBe("bearer");
expect(PROVIDER_PRESETS["groq"].model).toBe("llama-3.3-70b-versatile");
});

it("deepseek preset is correct", () => {
expect(PROVIDER_PRESETS["deepseek"].baseUrl).toContain("api.deepseek.com");
expect(PROVIDER_PRESETS["deepseek"].authStyle).toBe("bearer");
expect(PROVIDER_PRESETS["deepseek"].model).toBe("deepseek-chat");
});

it("together preset is correct", () => {
expect(PROVIDER_PRESETS["together"].baseUrl).toContain("api.together.xyz");
expect(PROVIDER_PRESETS["together"].authStyle).toBe("bearer");
});

it("mistral preset is correct", () => {
expect(PROVIDER_PRESETS["mistral"].baseUrl).toContain("api.mistral.ai");
expect(PROVIDER_PRESETS["mistral"].authStyle).toBe("bearer");
});
});

describe("MiMoClient auth styles", () => {
Expand Down
Loading