This package provides a deprecated integration module that enables Java applications to interact with GitHub Models through the LangChain4j framework. It offers chat models (both synchronous and streaming), embedding models, and support for AI services with tool integration, JSON schema responses, and responsible AI features. The module wraps Azure AI Inference SDK to provide a unified API for accessing various language models hosted on GitHub Models, including chat completion capabilities, embeddings generation, and content filtering management. As of version 1.10.0, this module has been marked for deprecation and future removal, with users recommended to migrate to the langchain4j-openai-official module for enhanced functionality and better integration. The library is designed for reusability as a foundational component in LLM-powered Java applications that need to leverage GitHub-hosted AI models, offering builder patterns for configuration, support for proxy options, custom timeouts, and comprehensive model service versioning capabilities.
—
Quality
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Type-safe enumerations for chat and embedding model names.
package dev.langchain4j.model.github;
public enum GitHubModelsChatModelName {
// OpenAI GPT
GPT_4_O,
GPT_4_O_MINI,
// Microsoft Phi
PHI_3_5_MINI_INSTRUCT,
PHI_3_5_VISION_INSTRUCT,
PHI_3_MEDIUM_INSTRUCT_128K,
PHI_3_MEDIUM_INSTRUCT_4K,
PHI_3_MINI_INSTRUCT_128K,
PHI_3_MINI_INSTRUCT_4K,
PHI_3_SMALL_INSTRUCT_128K,
PHI_3_SMALL_INSTRUCT_8K,
// AI21 Jamba
AI21_JAMBA_1_5_LARGE,
AI21_JAMBA_1_5_MINI,
AI21_JAMBA_INSTRUCT,
// Cohere Command
COHERE_COMMAND_R,
COHERE_COMMAND_R_PLUS,
// Meta Llama
META_LLAMA_3_1_405B_INSTRUCT,
META_LLAMA_3_1_70B_INSTRUCT,
META_LLAMA_3_1_8B_INSTRUCT,
META_LLAMA_3_70B_INSTRUCT,
META_LLAMA_3_8B_INSTRUCT,
// Mistral
MISTRAL_NEMO,
MISTRAL_LARGE,
MISTRAL_LARGE_2407,
MISTRAL_SMALL;
public String toString();
}public String toString();Get model identifier string for API calls.
Returns:
package dev.langchain4j.model.github;
public enum GitHubModelsEmbeddingModelName {
TEXT_EMBEDDING_3_SMALL,
TEXT_EMBEDDING_3_LARGE,
COHERE_EMBED_V3_ENGLISH,
COHERE_EMBED_V3_MULTILINGUAL;
public String toString();
}public String toString();Get model identifier string for API calls.
Returns:
GPT_4_O // "gpt-4o" - Latest GPT-4, vision capable
GPT_4_O_MINI // "gpt-4o-mini" - Efficient, cost-effectivePHI_3_5_MINI_INSTRUCT // "Phi-3.5-mini-instruct"
PHI_3_5_VISION_INSTRUCT // "Phi-3.5-vision-instruct" - Vision capable
PHI_3_MEDIUM_INSTRUCT_128K // "Phi-3-medium-128k-instruct"
PHI_3_MEDIUM_INSTRUCT_4K // "Phi-3-medium-4k-instruct"
PHI_3_MINI_INSTRUCT_128K // "Phi-3-mini-128k-instruct"
PHI_3_MINI_INSTRUCT_4K // "Phi-3-mini-4k-instruct"
PHI_3_SMALL_INSTRUCT_128K // "Phi-3-small-128k-instruct"
PHI_3_SMALL_INSTRUCT_8K // "Phi-3-small-8k-instruct"AI21_JAMBA_1_5_LARGE // "ai21-jamba-1.5-large"
AI21_JAMBA_1_5_MINI // "ai21-jamba-1.5-mini"
AI21_JAMBA_INSTRUCT // "ai21-jamba-instruct"COHERE_COMMAND_R // "cohere-command-r"
COHERE_COMMAND_R_PLUS // "cohere-command-r-plus"META_LLAMA_3_1_405B_INSTRUCT // "meta-llama-3.1-405b-instruct"
META_LLAMA_3_1_70B_INSTRUCT // "meta-llama-3.1-70b-instruct"
META_LLAMA_3_1_8B_INSTRUCT // "meta-llama-3.1-8b-instruct"
META_LLAMA_3_70B_INSTRUCT // "meta-llama-3-70b-instruct"
META_LLAMA_3_8B_INSTRUCT // "meta-llama-3-8b-instruct"MISTRAL_NEMO // "Mistral-nemo"
MISTRAL_LARGE // "Mistral-large"
MISTRAL_LARGE_2407 // "Mistral-large-2407"
MISTRAL_SMALL // "Mistral-small"TEXT_EMBEDDING_3_SMALL // "text-embedding-3-small" - 1536 dimensions, custom dimensions supported
TEXT_EMBEDDING_3_LARGE // "text-embedding-3-large" - 3072 dimensions, custom dimensions supportedCOHERE_EMBED_V3_ENGLISH // "cohere-embed-v3-english" - 1024 dimensions, English only
COHERE_EMBED_V3_MULTILINGUAL // "cohere-embed-v3-multilingual" - 1024 dimensions, 100+ languages| Model | Default Dimensions | Custom Dimensions |
|---|---|---|
| TEXT_EMBEDDING_3_SMALL | 1536 | Yes |
| TEXT_EMBEDDING_3_LARGE | 3072 | Yes |
| COHERE_EMBED_V3_ENGLISH | 1024 | No |
| COHERE_EMBED_V3_MULTILINGUAL | 1024 | No |
import dev.langchain4j.model.github.GitHubModelsChatModelName;
import dev.langchain4j.model.github.GitHubModelsEmbeddingModelName;Install with Tessl CLI
npx tessl i tessl/maven-dev-langchain4j--langchain4j-github-modelsdocs